DataDiskAttachment

Manages attaching a Disk to a Virtual Machine.

NOTE: Data Disks can be attached either directly on the azure.compute.VirtualMachine resource, or using the azure.compute.DataDiskAttachment resource - 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_disk block in the azure.compute.VirtualMachine resource.

Create a DataDiskAttachment Resource

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);
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, ReadOnly and ReadWrite.

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.

ManagedDiskId string

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

VirtualMachineId string

The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.

CreateOption string

The Create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. Changing this forces a new resource to be created.

WriteAcceleratorEnabled bool

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

Caching string

Specifies the caching requirements for this Data Disk. Possible values include None, ReadOnly and ReadWrite.

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.

ManagedDiskId string

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

VirtualMachineId string

The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.

CreateOption string

The Create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. Changing this forces a new resource to be created.

WriteAcceleratorEnabled bool

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

caching string

Specifies the caching requirements for this Data Disk. Possible values include None, ReadOnly and ReadWrite.

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.

managedDiskId string

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

virtualMachineId string

The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.

createOption string

The Create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. Changing this forces a new resource to be created.

writeAcceleratorEnabled boolean

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

caching str

Specifies the caching requirements for this Data Disk. Possible values include None, ReadOnly and ReadWrite.

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_id str

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

virtual_machine_id str

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 Empty or Attach. Defaults to Attach. Changing this forces a new resource to be created.

write_accelerator_enabled bool

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the DataDiskAttachment 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 str
The provider-assigned unique ID for this managed resource.

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): DataDiskAttachment
static 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, ReadOnly and ReadWrite.

CreateOption string

The Create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. 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.

ManagedDiskId string

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

VirtualMachineId string

The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.

WriteAcceleratorEnabled bool

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

Caching string

Specifies the caching requirements for this Data Disk. Possible values include None, ReadOnly and ReadWrite.

CreateOption string

The Create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. 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.

ManagedDiskId string

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

VirtualMachineId string

The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.

WriteAcceleratorEnabled bool

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

caching string

Specifies the caching requirements for this Data Disk. Possible values include None, ReadOnly and ReadWrite.

createOption string

The Create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. 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.

managedDiskId string

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

virtualMachineId string

The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.

writeAcceleratorEnabled boolean

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

caching str

Specifies the caching requirements for this Data Disk. Possible values include None, ReadOnly and ReadWrite.

create_option str

The Create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. 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_id str

The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.

virtual_machine_id str

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_enabled bool

Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.