Interview Prep/Real-World Interview/Multi-env and multi-account

You have 30 VPCs across accounts, some with overlapping CIDRs, and they need to talk to each other. What's your design?

AdvancedScenarioMulti-env and multi-account
Answer

Situation read → Peering doesn't scale (it's not transitive, and 30 VPCs would need hundreds of connections) and can't connect overlapping ranges. You need a hub and a fix for the overlaps.

What I'd do →

  1. Use AWS Transit Gateway in a network account, shared via RAM, with route tables segmenting prod from non-prod.
  2. Fix overlaps going forward: allocate CIDRs centrally with VPC IPAM so new VPCs never overlap.
  3. For existing overlaps:
    • Re-IP the less critical VPC if practical, or
    • Use private NAT gateways with a routable secondary CIDR to translate, or
    • Expose services through PrivateLink (endpoint services), which doesn't care about overlapping CIDRs.
  4. Centralise egress and inspection (Network Firewall) in the hub if security needs it.
  5. Everything in Terraform, with flow logs on the TGW attachments.

Why → TGW gives transitive hub routing; IPAM stops the problem from growing; PrivateLink handles service-to-service across overlaps.

Interview tip → PrivateLink as the answer for overlapping CIDRs is the senior detail.

All Real-World Interview questions Roadmap: Interview readiness

More on Multi-env and multi-account