DiskPoolIscsiTarget

class DiskPoolIscsiTarget : KotlinCustomResource

Manages an iSCSI Target. !>Note: Azure are officially halting the preview of Azure Disk Pools, and it will not be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. !>Note: Each Disk Pool can have a maximum of 1 iSCSI Target.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
import com.pulumi.azure.compute.DiskPool;
import com.pulumi.azure.compute.DiskPoolArgs;
import com.pulumi.azure.compute.ManagedDisk;
import com.pulumi.azure.compute.ManagedDiskArgs;
import com.pulumi.azuread.AzureadFunctions;
import com.pulumi.azuread.inputs.GetServicePrincipalArgs;
import com.pulumi.azure.authorization.Assignment;
import com.pulumi.azure.authorization.AssignmentArgs;
import com.pulumi.azure.compute.DiskPoolManagedDiskAttachment;
import com.pulumi.azure.compute.DiskPoolManagedDiskAttachmentArgs;
import com.pulumi.azure.compute.DiskPoolIscsiTarget;
import com.pulumi.azure.compute.DiskPoolIscsiTargetArgs;
import com.pulumi.codegen.internal.KeyedValue;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.addressSpaces("10.0.0.0/16")
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.0.0/24")
.delegations(SubnetDelegationArgs.builder()
.name("diskspool")
.serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
.actions("Microsoft.Network/virtualNetworks/read")
.name("Microsoft.StoragePool/diskPools")
.build())
.build())
.build());
var exampleDiskPool = new DiskPool("exampleDiskPool", DiskPoolArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.subnetId(exampleSubnet.id())
.zones("1")
.skuName("Basic_B1")
.build());
var exampleManagedDisk = new ManagedDisk("exampleManagedDisk", ManagedDiskArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.createOption("Empty")
.storageAccountType("Premium_LRS")
.diskSizeGb(4)
.maxShares(2)
.zone("1")
.build());
final var exampleServicePrincipal = AzureadFunctions.getServicePrincipal(GetServicePrincipalArgs.builder()
.displayName("StoragePool Resource Provider")
.build());
final var roles =
"Disk Pool Operator",
"Virtual Machine Contributor";
for (var i = 0; i < roles.length(); i++) {
new Assignment("exampleAssignment-" + i, AssignmentArgs.builder()
.principalId(exampleServicePrincipal.applyValue(getServicePrincipalResult -> getServicePrincipalResult.id()))
.roleDefinitionName(roles[range.value()])
.scope(exampleManagedDisk.id())
.build());
}
var exampleDiskPoolManagedDiskAttachment = new DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", DiskPoolManagedDiskAttachmentArgs.builder()
.diskPoolId(exampleDiskPool.id())
.managedDiskId(exampleManagedDisk.id())
.build(), CustomResourceOptions.builder()
.dependsOn(exampleAssignment)
.build());
var exampleDiskPoolIscsiTarget = new DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", DiskPoolIscsiTargetArgs.builder()
.aclMode("Dynamic")
.disksPoolId(exampleDiskPool.id())
.targetIqn("iqn.2021-11.com.microsoft:test")
.build(), CustomResourceOptions.builder()
.dependsOn(exampleDiskPoolManagedDiskAttachment)
.build());
}
}

Import

iSCSI Targets can be imported using the resource id, e.g.

$ pulumi import azure:compute/diskPoolIscsiTarget:DiskPoolIscsiTarget example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.StoragePool/diskPools/pool1/iscsiTargets/iscsiTarget1

Properties

Link copied to clipboard
val aclMode: Output<String>

Mode for Target connectivity. The only supported value is Dynamic for now. Changing this forces a new iSCSI Target to be created.

Link copied to clipboard
val disksPoolId: Output<String>

The ID of the Disk Pool. Changing this forces a new iSCSI Target to be created.

Link copied to clipboard
val endpoints: Output<List<String>>

List of private IPv4 addresses to connect to the iSCSI Target.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The name of the iSCSI Target. The name can only contain lowercase letters, numbers, periods, or hyphens, and length should between 5-223. Changing this forces a new iSCSI Target to be created.

Link copied to clipboard
val port: Output<Int>

The port used by iSCSI Target portal group.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val targetIqn: Output<String>?

ISCSI Target IQN (iSCSI Qualified Name); example: iqn.2005-03.org.iscsi:server. IQN should follow the format iqn.yyyy-mm.<abc>.<pqr>[:xyz]; supported characters include alphanumeric characters in lower case, hyphen, dot and colon, and the length should between 4 and 223. Changing this forces a new iSCSI Target to be created.

Link copied to clipboard
val urn: Output<String>