我设置了Azure虚拟机规模,并希望通过azurerm_dev_test_global_vm_shutdown_schedule资源计划虚拟机关闭。但我认为它在尝试获取virtual_machine_id时抛出了以下错误。有人遇到过类似的问题吗?
resource "azurerm_dev_test_global_vm_shutdown_schedule" "vm_shutdown" {
virtual_machine_id = azurerm_linux_virtual_machine_scale_set.vmss.id
location = data.azurerm_resource_group.rg.location
enabled = true
depends_on = [azurerm_linux_virtual_machine_scale_set.vmss]
daily_recurrence_time = "2000"
timezone = "Central Europe Standard Time"
notification_settings {
enabled = true
}
}
我在Terraform计划期间收到以下错误:
错误:ID缺少virtualMachines
元素│ │带有azurerm_dev_test_global_vm_shutdown_schedule.vm_shutdown,│位于04_linux_virtual_machine_scale_set. tf第57行,资源“azurerm_dev_test_global_vm_shutdown_schedule”“vm_shutdown”中:│ 57:虚拟机标识= azurerm_linux_virtual_machine_scale_set.vmss.id
1条答案
按热度按时间f3temu5u1#
对于
virtual_machine_id
,您必须使用azurerm_linux_virtual_machine
的ID,而不是azurerm_linux_virtual_machine_scale_set
。