I'm facing a networking issue with our AWS setup and could use some insights. We have several AWS accounts with multiple VPCs:
- In our non-prod account, we have 1 VPC for that environment.
- In our testing account, there are 2 VPCs, but here's the catch: the CIDR ranges for both VPCs in the testing account overlap, which is becoming a major blocker.
We plan to introduce new VPCs in each account to host Azure DevOps pipeline agents. In the non-prod account, the setup seems straightforward since we can create VPC peering. However, in the testing account, the overlapping CIDR blocks prevent this.
We have some constraints:
- We cannot modify the existing VPCs or their CIDRs.
- The solution must work across all accounts with CloudFormation templates.
- We need reliable connectivity between the agents' VPC and the application VPCs.
What do you think are our options? Could a Transit Gateway help here, given our situation?
5 Answers
If it's really necessary to connect those overlapping VPCs, a Transit Gateway might assist, but it requires careful planning. Just remember, it's usually better to avoid overlapping CIDRs altogether if you can help it. You might also want to consider AWS's private links or VPC lattice solution, which can help with certain traffic requirements without the mess of overlapping routes.
It sounds like you really need to revamp your network layout. If you can't adjust the existing VPCs, then it might be time to consider a redesign or even implementing NAT to handle the overlapping CIDRs. Just keep in mind that introducing NAT can create some headaches in the future. It's tough to deal with once you have a tangled web of overlapping networks.
Redesigning is definitely the way to go if you want to avoid future headaches. If you have the resources, starting fresh with non-overlapping CIDR ranges could save you a lot of trouble.
You know, it's critical to have a solid networking plan in place. Just introducing a new VPC with a good CIDR range can work wonders for avoiding these scenarios. Also, if your agents are pulling their tasks from Azure DevOps, you might not even need constant communication between the VPCs, so rethink if they truly need to interact.
Honestly, the best approach would be to rebuild your environment from scratch with clear non-overlapping ranges. If you're using infrastructure as code, like Terraform, it should be a smoother process. Otherwise, you're setting yourself up for a lot of maintenance issues down the line trying to patch things together.
I hear you! A clean slate would definitely make things easier. Plus, you could implement a better IP address management strategy going forward.
From what I've seen, if you can't manage to change the existing configurations, consider using IP Address Management (IPAM) in AWS. It allows you to manage your IP spaces effectively without overlaps and could help you allocate new CIDRs for your new VPCs more efficiently.

VPC lattice sounds interesting! I’ve heard it can simplify these kinds of issues, but we haven't deployed it yet in our environment.