是否有可能在不诉诸于的情况下HCL
让嵌套迭代返回一个平面?list(map)
flatten
我有这个:
locals {
mappings = flatten([
for record_type in var.record_types : [
for host in var.hosts : {
type = record_type,
host = host
}
]
])
}
我想消除对flatten
这样的需求:
locals {
mappings = [
for record_type in var.record_types :
for host in var.hosts : {
type = record_type,
host = host
}
]
}
但似乎每个人都for .. in
必须返回数据。