DataDiskAttachment
Manages attaching a Disk to a Virtual Machine.
NOTE: Data Disks can be attached either directly on the
azure.compute.VirtualMachineresource, or using theazure.compute.DataDiskAttachmentresource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur.Please Note: only Managed Disks are supported via this separate resource, Unmanaged Disks can be attached using the
storage_data_diskblock in theazure.compute.VirtualMachineresource.
Create a DataDiskAttachment Resource
new DataDiskAttachment(name: string, args: DataDiskAttachmentArgs, opts?: CustomResourceOptions);def DataDiskAttachment(resource_name, opts=None, caching=None, create_option=None, lun=None, managed_disk_id=None, virtual_machine_id=None, write_accelerator_enabled=None, __props__=None);func NewDataDiskAttachment(ctx *Context, name string, args DataDiskAttachmentArgs, opts ...ResourceOption) (*DataDiskAttachment, error)public DataDiskAttachment(string name, DataDiskAttachmentArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DataDiskAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DataDiskAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DataDiskAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DataDiskAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DataDiskAttachment resource accepts the following input properties:
- Caching string
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- Lun int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- Virtual
Machine stringId The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- Create
Option string The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- Write
Accelerator boolEnabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
- Caching string
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- Lun int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- Virtual
Machine stringId The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- Create
Option string The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- Write
Accelerator boolEnabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
- caching string
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- lun number
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- managed
Disk stringId The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- virtual
Machine stringId The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- create
Option string The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- write
Accelerator booleanEnabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
- caching str
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- lun float
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- managed_
disk_ strid The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- virtual_
machine_ strid The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- create_
option str The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- write_
accelerator_ boolenabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
Outputs
All input properties are implicitly available as output properties. Additionally, the DataDiskAttachment resource produces the following output properties:
Look up an Existing DataDiskAttachment Resource
Get an existing DataDiskAttachment 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?: DataDiskAttachmentState, opts?: CustomResourceOptions): DataDiskAttachmentstatic get(resource_name, id, opts=None, caching=None, create_option=None, lun=None, managed_disk_id=None, virtual_machine_id=None, write_accelerator_enabled=None, __props__=None);func GetDataDiskAttachment(ctx *Context, name string, id IDInput, state *DataDiskAttachmentState, opts ...ResourceOption) (*DataDiskAttachment, error)public static DataDiskAttachment Get(string name, Input<string> id, DataDiskAttachmentState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Caching string
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- Create
Option string The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- Lun int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- Virtual
Machine stringId The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- Write
Accelerator boolEnabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
- Caching string
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- Create
Option string The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- Lun int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- Virtual
Machine stringId The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- Write
Accelerator boolEnabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
- caching string
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- create
Option string The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- lun number
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- managed
Disk stringId The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- virtual
Machine stringId The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- write
Accelerator booleanEnabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
- caching str
Specifies the caching requirements for this Data Disk. Possible values include
None,ReadOnlyandReadWrite.- create_
option str The Create Option of the Data Disk, such as
EmptyorAttach. Defaults toAttach. Changing this forces a new resource to be created.- lun float
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
- managed_
disk_ strid The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
- virtual_
machine_ strid The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
- write_
accelerator_ boolenabled Specifies if Write Accelerator is enabled on the disk. This can only be enabled on
Premium_LRSmanaged disks with no caching and M-Series VMs. Defaults tofalse.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.