我已经生成了一个json文件,其中包含我想作为参数传递给Azure中模块的变量。
{
"ad": {
"NumInstances": "1",
"VMSize": "Standard_F2"
}
}
resource "azurerm_virtual_machine" "service_name" {
count = "<What goes here?>"
name = "${var.service_name}-${count.index}"
location = "${azurerm_resource_group.service_name.location}"
resource_group_name = "${azurerm_resource_group.service_name.name}"
network_interface_ids = ["${element(azurerm_network_interface.service_name.*.id, count.index)}"]
vm_size = "<What goes here?>"
availability_set_id = "${var.num_instances == 1 ? "" : "${azurerm_availability_set.service_name.id}"
}
这是如何实现的?