我正在尝试使用 Terraform 使用以前拍摄的快照作为 OS 磁盘来启动 Azure VM (RM)。
这就是我所拥有的。
data "azurerm_managed_disk" "windows-workstation_disk" {
name = "workstation-disk"
resource_group_name = "joeg"
}
## Workstation machine
resource "azurerm_virtual_machine" "windows-workstation" {
name = "windows-workstation"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
vm_size = "Standard_D2s_v3"
network_interface_ids = ["${azurerm_network_interface.windows-workstation_nic.id}"]
storage_os_disk {
name = "windows-workstation_osdisk"
managed_disk_id = "${data.azurerm_managed_disk.windows-workstation_disk.id}"
create_option = "Attach"
}
运行时出现以下错误terraform apply
Error applying plan:
1 error(s) occurred:
* azurerm_virtual_machine.windows-workstation: Resource
'data.azurerm_managed_disk.windows-workstation_disk' not found for variable
'data.azurerm_managed_disk.windows-workstation_disk.id'
有任何想法吗?