【Azure Terraform】terraformでsnapshotからAzureVirtulaMachineを作成する

resource "azurerm_virtual_machine" "main" { name = var.web01-vmname location = var.location resource_group_name = azurerm_resource_group.resource_group.name network_interface_ids = [azurerm_network_interface.main.id] vm_size = "Standard_DS1_v2" storage_os_disk { name = azurerm_managed_disk.root.name os_type = "Windows" managed_disk_id = azurerm_managed_disk.root.id create_option = "Attach" } } resource "azurerm_managed_disk" "root" { name = "root" location = "japaneast" resource_group_name = "backup" storage_account_type = "StandardSSD_LRS" create_option = "Copy" source_resource_id = "/subscriptions/9611116b-ea93-42fc-bc7a-6a1149bb2521/resourceGroups/backup/providers/Microsoft.Compute/snapshots/web-20201005" }