Use Terraform element wrap-around for AWS controllers subnet_id (#714)

* Fix Terraform plan error when controller_count exceeds available AWS zones (e.g. 5 controllers)
This commit is contained in:
Ben Drucker 2020-04-29 20:41:08 -07:00 committed by GitHub
parent 2c1af917ec
commit 317416b316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ resource "aws_instance" "controllers" {
# network # network
associate_public_ip_address = true associate_public_ip_address = true
subnet_id = aws_subnet.public.*.id[count.index] subnet_id = element(aws_subnet.public.*.id, count.index)
vpc_security_group_ids = [aws_security_group.controller.id] vpc_security_group_ids = [aws_security_group.controller.id]
lifecycle { lifecycle {

View File

@ -36,7 +36,7 @@ resource "aws_instance" "controllers" {
# network # network
associate_public_ip_address = true associate_public_ip_address = true
subnet_id = aws_subnet.public.*.id[count.index] subnet_id = element(aws_subnet.public.*.id, count.index)
vpc_security_group_ids = [aws_security_group.controller.id] vpc_security_group_ids = [aws_security_group.controller.id]
lifecycle { lifecycle {