terraform 所需的基本脚本帮助
我在 terraform 中有这个本地:
aws-temporary = var.environment == "dev" ? "aws." : ""
现在这被称为 in line:
name = "${var.hostname}.${local.aws-temporary}${data.aws_route53_zone.management_zone.name}"
现在,当“var.environment”是 dev .. 它确实在名称中添加了“.aws”。但是,当它不是 dev .. 时,它不会添加“.aws”。
我想要的是它在 dev 和其他环境中添加 .aws.. 但不在 dev2 中添加。
我将如何修改本地来做到这一点?任何帮助将不胜感激。谢谢
I have this local in terraform:
aws-temporary = var.environment == "dev" ? "aws." : ""
now this is called in line:
name = "${var.hostname}.${local.aws-temporary}${data.aws_route53_zone.management_zone.name}"
Now when the "var.environment" is dev .. it does add the ".aws" in the name. However, when it is something else than dev .. it does not add the ".aws".
What I want is that it adds the .aws in dev and other envs.. but not add in dev2.
How would I modify the local to do that? any help would be appreciated. thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是将条件切换为:
或相同的另一种变体:
I would just switch the condition to:
Or another variation of the same: