Azure Classic
DiskPoolManagedDiskAttachment
Manages a Disk Pool Managed Disk Attachment.
Note: Must be either a premium SSD, standard SSD, or an ultra disk in the same region and availability zone as the disk pool.
Note: Ultra disks must have a disk sector size of 512 bytes.
Note: Must be a shared disk, with a maxShares value of two or greater.
Note: You must provide the StoragePool resource provider RBAC permissions to the disks that will be added to the disk pool.
Example Usage
Coming soon!
Coming soon!
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import com.pulumi.codegen.internal.KeyedValue;
import com.pulumi.resources.CustomResourceOptions;
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)
.zones("1")
.build());
final var exampleServicePrincipal = Output.of(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.apply(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());
}
}
Coming soon!
Coming soon!
Coming soon!
Create a DiskPoolManagedDiskAttachment Resource
new DiskPoolManagedDiskAttachment(name: string, args: DiskPoolManagedDiskAttachmentArgs, opts?: CustomResourceOptions);
@overload
def DiskPoolManagedDiskAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
disk_pool_id: Optional[str] = None,
managed_disk_id: Optional[str] = None)
@overload
def DiskPoolManagedDiskAttachment(resource_name: str,
args: DiskPoolManagedDiskAttachmentArgs,
opts: Optional[ResourceOptions] = None)
func NewDiskPoolManagedDiskAttachment(ctx *Context, name string, args DiskPoolManagedDiskAttachmentArgs, opts ...ResourceOption) (*DiskPoolManagedDiskAttachment, error)
public DiskPoolManagedDiskAttachment(string name, DiskPoolManagedDiskAttachmentArgs args, CustomResourceOptions? opts = null)
public DiskPoolManagedDiskAttachment(String name, DiskPoolManagedDiskAttachmentArgs args)
public DiskPoolManagedDiskAttachment(String name, DiskPoolManagedDiskAttachmentArgs args, CustomResourceOptions options)
type: azure:compute:DiskPoolManagedDiskAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DiskPoolManagedDiskAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DiskPoolManagedDiskAttachmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DiskPoolManagedDiskAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DiskPoolManagedDiskAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DiskPoolManagedDiskAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DiskPoolManagedDiskAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The DiskPoolManagedDiskAttachment resource accepts the following input properties:
- Disk
Pool stringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- Managed
Disk stringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- Disk
Pool stringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- Managed
Disk stringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk
Pool StringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed
Disk StringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk
Pool stringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed
Disk stringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk_
pool_ strid The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed_
disk_ strid The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk
Pool StringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed
Disk StringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the DiskPoolManagedDiskAttachment resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up an Existing DiskPoolManagedDiskAttachment Resource
Get an existing DiskPoolManagedDiskAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DiskPoolManagedDiskAttachmentState, opts?: CustomResourceOptions): DiskPoolManagedDiskAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
disk_pool_id: Optional[str] = None,
managed_disk_id: Optional[str] = None) -> DiskPoolManagedDiskAttachment
func GetDiskPoolManagedDiskAttachment(ctx *Context, name string, id IDInput, state *DiskPoolManagedDiskAttachmentState, opts ...ResourceOption) (*DiskPoolManagedDiskAttachment, error)
public static DiskPoolManagedDiskAttachment Get(string name, Input<string> id, DiskPoolManagedDiskAttachmentState? state, CustomResourceOptions? opts = null)
public static DiskPoolManagedDiskAttachment get(String name, Output<String> id, DiskPoolManagedDiskAttachmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Disk
Pool stringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- Managed
Disk stringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- Disk
Pool stringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- Managed
Disk stringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk
Pool StringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed
Disk StringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk
Pool stringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed
Disk stringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk_
pool_ strid The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed_
disk_ strid The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
- disk
Pool StringId The ID of the Disk Pool. Changing this forces a new Disk Pool Managed Disk Attachment to be created.
- managed
Disk StringId The ID of the Managed Disk. Changing this forces a new Disks Pool Managed Disk Attachment to be created.
Import
Disks Pool Managed Disk Attachments can be imported using the resource id
, e.g.
$ pulumi import azure:compute/diskPoolManagedDiskAttachment:DiskPoolManagedDiskAttachment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.StoragePool/diskPools/storagePool1/managedDisks|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Compute/disks/disk1
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.