【发布时间】:2020-05-10 09:59:30
【问题描述】:
我正在尝试从 terraform 地图变量中提取左值和右值,但无法提取左值。下面是我的代码:-
variables.tf
variable "notebook" {
type = "map"
default = {
"01" = "a@a.com"
"02" = "b@a.com"
"03" = "c@a.com"
"04" = "d@a.com"
......
}
}
下面是我在 main.tf 中的模块
module "instance" {
instance_ip = ["1.1.1.x", "1.1.2.y", "1.1.1.z","1.1.2.p"]
dns = ["x", "y", "z","p"]
name = ["a", "b", "c", "d"]
}
输出应该如下:-
module "instance" {
instance_ip = ["1.1.1.01", "1.1.2.02", "1.1.1.03","1.1.2.04" and so on]
dns = ["01", "02", "03","04" and so on]
name = ["a@a.com", "b@a.com", "c@a.com", "d@a.com and so on]
}
任何建议。我尝试查找变量,但只得到 a@a.com 而不是密钥。
【问题讨论】:
标签: terraform terraform-provider-aws