变量地图的默认值是否与我提供给 terraform 的数据合并?
示例变量.tf:
variable "foo" {
type = map
default = {
lorem = "ipsum"
dolor = "sit"
}
}
并且 foo.tfvars 提供:
foo = {
dolor = "changed"
amet = "consectetur"
}
${foo.lorem}
还会存在吗?
${foo.dolor}
会被「改变」吗?
${foo.amet}
可用吗?
为了澄清,如果您指定了 tfvars 文件,您会得到:
${foo.lorem} = "Error: Missing map element"
${foo.dolor} = "changed"
${foo.amet} = "consectetur"