The following arguments are supported:
Note:
Azure Ultra Disk Storage is only available in a region that support availability zones and can only enabled on the following VM series: ESv3, DSv3, FSv3, LSv2, M and Mv2. For more information see the Azure Ultra Disk Storage product documentation.
NOTE:
The Disk Encryption Set must have the Reader Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault
NOTE:
Disk Encryption Sets are in Public Preview in a limited set of regions
NOTE:
In certain conditions the Data Disk size can be updated without shutting down the Virtual Machine, however only a subset of Virtual Machine SKUs/Disk combinations support this. More information can be found for Linux Virtual Machines and Windows Virtual Machines respectively.
NOTE:
If No Downtime Resizing is not available, be aware that changing this value is disruptive if the disk is attached to a Virtual Machine. The VM will be shut down and de-allocated as required by Azure to action the change. Terraform will attempt to start the machine again after the update if it was in a running state when the apply was started.
NOTE:
Removing encryption_settings forces a new resource to be created.
NOTE:
Setting logical sector size is supported only with UltraSSD_LRS disks and PremiumV2_LRS disks.
NOTE:
Changing this value is disruptive if the disk is attached to a Virtual Machine. The VM will be shut down and de-allocated as required by Azure to action the change. Terraform will attempt to start the machine again after the update if it was in a running state when the apply was started.
Note:
Premium SSD maxShares limit: P15 and P20 disks: 2. P30,P40,P50 disks: 5. P60,P70,P80 disks: 10. For ultra disks the max_shares minimum value is 1 and the maximum is 5.
Note:
Trusted Launch can only be enabled when create_option is FromImage or Import.
NOTE:
When security_type is set to ConfidentialVM_DiskEncryptedWithCustomerKey the value of create_option must be one of FromImage or ImportSecure.
NOTE:
security_type cannot be specified when trusted_launch_enabled is set to true.
NOTE:
secure_vm_disk_encryption_set_id must be specified when security_type is set to ConfidentialVM_DiskEncryptedWithCustomerKey.
NOTE:
secure_vm_disk_encryption_set_id can only be specified when security_type is set to ConfidentialVM_DiskEncryptedWithCustomerKey.
Note:
Credit-Based Bursting is enabled by default on all eligible disks. More information on Credit-Based and On-Demand Bursting can be found in the documentation.
Note:
Availability Zones are only supported in select regions at this time.
Note:
disk_access_id is only supported when network_access_policy is set to AllowPrivate.
For more information on managed disks, such as sizing options and pricing, please check out the Azure Documentation.
The disk_encryption_key block supports:
The encryption_settings block supports:
The key_encryption_key block supports:
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_managed_disk" "example" {
name = "acctestmd"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
storage_account_type = "Standard_LRS"
create_option = "Empty"
disk_size_gb = "1"
tags = {
environment = "staging"
}
}
az disk create --name
--resource-group
[--accelerated-network {false, true}]
[--architecture {Arm64, x64}]
[--data-access-auth-mode {AzureActiveDirectory, None}]
[--disk-access]
[--disk-encryption-set]
[--disk-iops-read-only]
[--disk-iops-read-write]
[--disk-mbps-read-only]
[--disk-mbps-read-write]
[--edge-zone]
[--enable-bursting {false, true}]
[--encryption-type {EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey}]
[--gallery-image-reference]
[--gallery-image-reference-lun]
[--hyper-v-generation {V1, V2}]
[--image-reference]
[--image-reference-lun]
[--location]
[--logical-sector-size]
[--max-shares]
[--network-access-policy {AllowAll, AllowPrivate, DenyAll}]
[--no-wait]
[--os-type {Linux, Windows}]
[--performance-plus {false, true}]
[--public-network-access {Disabled, Enabled}]
[--secure-vm-disk-encryption-set]
[--security-data-uri]
[--security-type {ConfidentialVM_DiskEncryptedWithCustomerKey, ConfidentialVM_DiskEncryptedWithPlatformKey, ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey, TrustedLaunch}]
[--size-gb]
[--sku {PremiumV2_LRS, Premium_LRS, Premium_ZRS, StandardSSD_LRS, StandardSSD_ZRS, Standard_LRS, UltraSSD_LRS}]
[--source]
[--source-storage-account-id]
[--support-hibernation {false, true}]
[--tags]
[--tier]
[--upload-size-bytes]
[--upload-type {Upload, UploadWithSecurityData}]
[--zone {1, 2, 3}]
az disk create -g MyResourceGroup -n MyDisk --size-gb 10
Categorized by Availability, Security & Compliance and Cost