【发布时间】:2021-05-25 20:34:36
【问题描述】:
我正在尝试遍历变量类型映射,但我不确定如何
这是我目前所拥有的
在我的 main.tf 中:
resource "aws_route_53_record" "proxy_dns" {
count = "${length(var.account_name)}"
zone_id = "${infrastructure.zone_id}"
name = "proxy-${element(split(",", var.account_name), count.index)}-dns
type = CNAME
ttl = 60
records = ["{records.dns_name}"]
}
在我的 variables.tf 中
variable "account_name" {
type = "map"
default = {
"account1" = "accountA"
"account2" = "accountB"
}
}
我希望能够使用不同的帐户名称创建多个资源
【问题讨论】:
标签: amazon-web-services terraform amazon-route53