Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS - NAT Gateways & Route Tables - Only one NAT Gateway being used for all AZ routes #71

Open
JakeBogie opened this issue Jan 22, 2021 · 4 comments
Labels
pr-welcome We'd prioritize review, acceptance, and release of PRs addressing this issue

Comments

@JakeBogie
Copy link

Describe the bug
NAT Gateways and Route Tables are created for the Availability Zones in AWS that Paving creates. If we create 3 Availability Zones we should get a route table and a NAT Gateway per AZ. When the route tables are configured all of the route tables (route-az0, route-az1, and route-az2) all use one NAT Gateway...and from my observation it's the first NAT Gateway created.

To Reproduce
Run Paving in AWS, view all of the route tables and notate what NAT Gateway is being used in the route tables.

Expected behavior
Each AZ gets a route table with the associated NAT Gateway defined for that AZ set as the default route for all 0.0.0.0/0 traffic.

Environment (please complete the following information):
AWS
paving v1.0.0

@anEXPer
Copy link
Contributor

anEXPer commented Jan 22, 2021

This is coming to our attention in part because AWS gives a notification that the configuration is wrong; would you mind including the text of that notification?

We don't have dedicated maintainers on this, so it may take us a bit to allocate work to it, but we probably will in the next two or three months. In the meantime, we'd definitely take a PR. Initial investigation suggests we don't need to worry about how the NAT gateway configuration would impact, for instance, the stable config, as it ends up just being a default for everything that gets put on the subnet. So, hopefully, this can be done as a pretty small change.

@anEXPer anEXPer added the pr-welcome We'd prioritize review, acceptance, and release of PRs addressing this issue label Jan 22, 2021
@JakeBogie
Copy link
Author

This is coming to our attention in part because AWS gives a notification that the configuration is wrong; would you mind including the text of that notification?

Screen Shot 2021-01-26 at 13 01 32

@sbogar-shs
Copy link

I just noticed this myself, i think the fix is to change line 10 of the route-tables tf to
nat_gateway_id = element(aws_nat_gateway.nat[*].id, count.index)

@anEXPer
Copy link
Contributor

anEXPer commented Mar 22, 2021

Lovely, we'd take a PR to this effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-welcome We'd prioritize review, acceptance, and release of PRs addressing this issue
Projects
None yet
Development

No branches or pull requests

3 participants