The following arguments are supported:
Note:
One of source_uri, source_resource_id or storage_account_id must be specified.
NOTE:
Removing encryption_settings forces a new resource to be created.
The encryption_settings block supports:
The disk_encryption_key block supports:
The key_encryption_key block supports:
resource "azurerm_resource_group" "example" {
name = "snapshot-rg"
location = "West Europe"
}
resource "azurerm_managed_disk" "example" {
name = "managed-disk"
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 = "10"
}
resource "azurerm_snapshot" "example" {
name = "snapshot"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
create_option = "Copy"
source_uri = azurerm_managed_disk.example.id
}
az snapshot create --name
--resource-group
[--accelerated-network {false, true}]
[--architecture {Arm64, x64}]
[--copy-start {false, true}]
[--disk-access]
[--disk-encryption-set]
[--edge-zone]
[--encryption-type {EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey}]
[--for-upload {false, true}]
[--hyper-v-generation {V1, V2}]
[--incremental {false, true}]
[--location]
[--network-access-policy {AllowAll, AllowPrivate, DenyAll}]
[--no-wait]
[--public-network-access {Disabled, Enabled}]
[--size-gb]
[--sku {Premium_LRS, Standard_LRS, Standard_ZRS}]
[--source]
[--source-storage-account-id]
[--tags]
az snapshot create -g MyResourceGroup -n MySnapshot2 --source MyDisk
Categorized by Availability, Security & Compliance and Cost