Not able to add multiple target_id inside targer group using terraform
问题 I'm trying to create target groups and attach multiple machines to the target groups using terraform script. I'm not able to attach multiple target_id please help me to achieve this. 回答1: As of Terraform 0.12 , this could simply be 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 } assuming aws_instance.test returns a list . https://blog.gruntwork.io/terraform