我正在尝试创建目标组并使用 terraform 脚本将多台机器附加到目标组。
我无法附加多个 target_id 请帮助我实现这一目标。
最佳答案
截至 Terraform 0.12
,这可能只是
resource "aws_alb_target_group_attachment" "test" {
count = length(aws_instance.test)
target_group_arn = aws_alb_target_group.test.arn
target_id = aws_instance.test[count.index].id
}
假设
aws_instance.test
返回 list
.https://blog.gruntwork.io/terraform-tips-tricks-loops-if-statements-and-gotchas-f739bbae55f9是极好的引用。
关于amazon-web-services - 无法使用 terraform 在目标组中添加多个 target_id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44491994/