I am trying to put up a VPC architecture for different environments (dev/test/pre-prod/prod) and I am facing an issue with respect to restriction of Elastic IP limits. It would be great to know if the architecture is going in the correct direction in the first place. So let me explain you the details here:
- 1 VPC for all environments with 1 Internet Gateway
- VPC in one region
- 3 Availability Zones with 1 private subnet and 1 utility subnet for each (total of 6 subnets)
- 3 NAT Gateways - one for each utility subnet with 3 Elastic IPs assigned to their network interfaces
- EC2 Instances (master and node) in each private subnet
- Virtual private gateway to connect to corporate network
I am using Terraform to automate this whole infrastructure as code (this doesn't matter too much here). When I run the Terraform script for one environment (let's say dev), the whole infrastructure detailed above is created fine and works good. But now when I run the script for another environment (say test), I run out of Elastic IPs (because there is a limit of 5 EIPs per region).
What's the best way to re-architect this so I can create infrastructure for different environments while not hitting these EIP limits?
Thanks much for your help. Please let me know if more details needed.
Regards, Abdul