有没有办法在terraform中创建多个资源?
如果我想创建3个资源组并调用它们rg1,rg2,rg3这样做的语法是什么?
我已经尝试过以下但是它不起作用
resource "azurerm_resource_group" "rg" {
name = "rg",count
location = "west europe"
count = "3"
}
答案 0 :(得分:1)
resource "azurerm_resource_group" "rg" {
name = "rg${count.index}"
location = "west europe"
count = "3"
}