【发布时间】:2020-10-16 12:23:08
【问题描述】:
在 terraform 版本从 0.11 更新到 0.12.26 后,我看到地图内的查找和值列表出错。
variable "foo" {
type = map
}
foo = {
x.y = "bar"
}
我有一个映射“foo”作为变量类型(映射),然后我在映射中有 x.y =“bar”的键值对。在查找中,我试图将 x.y 的值读取为,
lookup(var.foo, x.y)
这样,我得到了错误,
Error: Ambiguous attribute key
on line 13:
13: x.y = "bar"
If this expression is intended to be a reference, wrap it in parentheses. If
it's instead intended as a literal name containing periods, wrap it in quotes
to create a string literal.
有人可以帮忙吗?
【问题讨论】:
标签: terraform terraform-provider-aws terraform0.12+