我想创建多个 acm 证书和 Route53 记录以进行验证,只是无法弄清楚如何引用 Route53 资源块中的 for_each 创建的所有 ACM 资源,该资源块在 ACM 资源中循环以获取所有 DNS _validation 属性,代码正在运行如果我在变量中设置一个证书并直接使用名称引用它,那很好,但是如何循环到所有域名以在 for 循环中引用它?\n问题是这一行
\nfor dvo in aws_acm_certificate.web[for i in keys(var.certificates) : i]
正在返回
\n The index operator must end with a closing bracket ("]").
像这样添加第二个括号
\nfor dvo in aws_acm_certificate.web[[for i in keys(var.certificates) : i]]
返回错误
\n\xe2\x94\x82\n\xe2\x94\x82 on main.tf line 21, in resource "aws_route53_record" "domain_validation":\n\xe2\x94\x82 21: for dvo in aws_acm_certificate.web[[for i in keys(var.certificates) : i]].domain_validation_options : dvo.domain_name => {\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\n\xe2\x94\x82 …
Run Code Online (Sandbox Code Playgroud)