-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
Description
Lines 1237 to 1240 in b3fb14f
| subnet_id = element( | |
| aws_subnet.public[*].id, | |
| var.single_nat_gateway ? 0 : count.index, | |
| ) |
The problem here is that the multiple subnets created in this module could be greater than the amount of AZs. So in my VPC sharing scenario, I end up having my NAT Gateways in the wrong subnets. Basically unless you create a number of public subnet = AZs you could have the same problem.
Solution?
- (Prefered) Would probably means an extra list(string) variable for defining the subnet(s) name(s) where the NAT Gateway should be put in.
- Restrict/validate the amount of public subnets not to be greater than the amount of AZs
Workaround, keep your public subnets that will have the NAT Gateways to be firsts in the list.
Can work on a PR if the direction is good, thanks for the feedbacks!