我想知道是否有可能得到一个地形列表的总数,我看过tf网站,并没有看到任何总数,只是使用count.index。
示例列表
var "testList"
type = "list"
default [
{
type = "test1"
},
{
type = "test2"
}
]
所以在这里我想得到2作为测试列表的总数
谢谢
你可以使用terraform内置函数length()
来计算。
count = "${length(var.testList)}"
有关详细信息,请查看terraform文档: