azurerm_snapshot

Manages a Disk Snapshot.

Example Usage

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
}

Argument Reference

The following arguments are supported:


The encryption_settings block supports:


The disk_encryption_key block supports:


The key_encryption_key block supports:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Snapshots can be imported using the resource id, e.g.

terraform import azurerm_snapshot.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/snapshots/snapshot1