我正在使用一个模块,该模块引用用于在 terraform 中构建 Puppet 服务器的中央模块。根模块中有一个变量允许与 ASG 一起使用附加标签,但我似乎无法正确理解语法。这是核心存储库中的信息:
variable "additional_asg_tags" {
description = "A map of additional tags to add to the puppet server ASG."
type = list(object({ key = string, value = string, propagate_at_launch = bool }))
default = []
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试了所有我能想到的方法来调用它,但它总是出现错误,并显示“不正确的列表元素类型:需要字符串”之类的消息。或“此默认值与变量的类型约束不兼容:需要对象列表。”
我试图用类似的东西来调用上面的内容;
variable "additional_asg_tags" {
description = "A map of additional tags to add to ASG."
type = list(object({ key = string, value = string, propagate_at_launch = bool }))
default = { key = "Name", value = "Puppet-nonprod", propagate_at_launch …Run Code Online (Sandbox Code Playgroud)