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

Custom amount of NAT gateways #1065

Open
aiell0 opened this issue Apr 13, 2024 · 2 comments
Open

Custom amount of NAT gateways #1065

aiell0 opened this issue Apr 13, 2024 · 2 comments

Comments

@aiell0
Copy link
Contributor

aiell0 commented Apr 13, 2024

Describe the solution you'd like.

Right now there are only two options for the amount of NAT gateways I want - either one or the amount of availability zones I am using. That's a bit limiting, us-east-1 for example has 6 availability zones and that can be overkill for some organizations who are cost conscious. What if I only want 3?

Describe alternatives you've considered.

I usually just disallow the module to create NAT gateways and create my own if I want a custom amount, and I felt that it should be in the module. The addition of the feature seemed simple enough.

Additional context

None

@bryantbiggs
Copy link
Member

us-east-1 for example has 6 availability zones and that can be overkill for some organizations who are cost conscious. What if I only want 3?

How do you setup routes for this scenario? what if someone wants 2 NAT gateways, how would you setup routes for 6 subnets to 2 NAT gateways - and how do you decide which AZ/subnets to place the NAT gateways within?

@aiell0
Copy link
Contributor Author

aiell0 commented Apr 26, 2024

@bryantbiggs IMO the best approach would be to let the user configure which AZs/subnets they wanted the NAT gateways in (including having multiple in the same subnet if they wanted for whatever reason). That part could be configurable.

As far as deciding how to route private subnets to them, I think we would have to balance them within the module. For example, if you wanted 2 NAT gateways in us-east-1 and you are deploying in all 6 AZs overall, then have us-east-1a, us-east-1c, and us-east-1e route to one NAT and us-east-1b, us-east-1d, and us-east-1f route to the other one.

I took a more naive approach in my PR but if the above sounds good, I will modify it to go with the above. Let me know how that sounds!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants