AWS VPC Essentials (Part 2): Scaling to Multi-VPC, Multi-Account, and Hybrid Cloud Architecture
A single VPC needs only its default local route so that all of its subnets can communicate with one another. But as workloads grow, infrastructure expands, and networking scales beyond the boundary of a single VPC, operations teams immediately face three entirely new challenges:
- Connectivity: How do packets travel securely across multiple VPCs or on-premises data centers?
- Name Resolution: How do workloads across disconnected networks resolve each other’s private domain names?
- Governance: When dozens of AWS accounts coexist, who manages CIDR allocations, and how should outbound internet traffic be inspected and routed centrally?
When interconnecting multiple VPCs and on-premises environments at Layer 3 (L3), three foundational networking principles remain constant: routing is governed by Longest Prefix Match in the route table (when multiple routes match a destination, the most specific prefix wins), connected networks must never have overlapping CIDRs, and every cross-network component has its own billing model. If you run into overlapping IP ranges or need cross-organization collaboration, you must instead shift to a Layer 4 (L4) approach that exposes only a single service.
Building on the foundations laid in Part 1, this guide breaks down cross-network cloud architectures and their practical evolutionary paths.
NOTE
Further reading: AWS VPC Fundamentals (Part 1): Routing, Firewalls, and Costs in a Single VPC
VPC Peering: One-to-One Private Interconnect
VPC Peering establishes a direct, 1-to-1 private network connection between two VPCs, supporting cross-account and cross-region topologies. Once provisioned, workloads communicate simply by adding a route pointing to the peer CIDR in each VPC’s route table and permitting traffic in Security Groups.
+-----------+ VPC Peering +-----------+
| VPC A | <-------------------> | VPC B |
| 10.0.0.0 | (Non-transitive) | 10.1.0.0 |
+-----------+ +-----------+
Despite its straightforward setup, VPC Peering has three important architectural constraints:
- No Overlapping CIDRs: Even if you only intend to route between non-overlapping subnets, peering cannot be established if the primary or secondary CIDR blocks of the VPCs overlap at all.
- Non-Transitive Routing: If VPC A peers with VPC B, and VPC A peers with VPC C, VPC B and C cannot communicate through A. VPC A will not act as a transit hop.
- No Edge-to-Edge Routing: VPC B cannot traverse VPC A to access its Internet Gateway, NAT Gateway, VPN, or Direct Connect connection.
Non-transitivity means that building a full-mesh topology scales quadratically with the number of VPCs. Fully interconnecting VPCs requires peering connections. Five VPCs require 10 connections; 20 VPCs require 190.
However, VPC Peering carries no hourly base charges. Data transfer within the same Availability Zone (AZ) is free, and cross-AZ traffic incurs standard cross-AZ data transfer fees ($0.01 per GB). For environments with few VPCs or heavy point-to-point traffic between specific pairs, VPC Peering remains highly cost-effective.
Transit Gateway: Moving from Full Mesh to Hub-and-Spoke
When VPC counts climb into double digits, managing a full-mesh peering topology becomes untenable. AWS Transit Gateway (TGW) acts as a regional virtual cloud router, consolidating your network topology into a hub-and-spoke architecture.
+-----------+ +---------------+ +-----------+
| VPC A |-------| |-------| VPC B |
+-----------+ | Transit | +-----------+
| Gateway |
+-----------+ | (Router) | +-----------+
| VPC C |-------| |-------| On-Prem |
+-----------+ +---------------+ +-----------+
Each VPC, VPN, or Direct Connect connection only requires a single Attachment to the Transit Gateway. Because TGW is transitive, on-premises networks connecting to TGW can seamlessly route to all attached VPCs.
TGW Routing Architecture and Network Segmentation
TGW manages routing across two distinct tiers:
- VPC Route Tables: Point the destination CIDR to the TGW attachment ID (
tgw-xxxx) to forward traffic out of the VPC. - TGW Route Tables: Control packet forwarding within the gateway via Association and Propagation.
An attachment can only associate with a single TGW route table—the gateway consults this table when forwarding packets originating from that attachment. However, an attachment can propagate its CIDR to multiple TGW route tables, advertising how other environments can return traffic to it. By configuring three TGW route tables, you can achieve strict environment isolation with shared service access:
rt-prod: Associated with production VPCs; receives route propagations only from production and shared services VPCs.rt-dev: Associated with development VPCs; receives route propagations only from development and shared services VPCs.rt-shared: Associated with shared services VPCs; receives route propagations from both prod and dev to establish return paths.
In this setup, production and development workloads can both reach shared services and receive responses, yet remain completely isolated from each other—eliminating the operational headache of maintaining cross-environment Security Group rules inside every VPC.
Cost Considerations and Hybrid Topologies
According to Transit Gateway pricing, each attachment incurs an hourly fee ($0.05/hour, roughly $36.50/month), plus an additional $0.02 per GB data processing fee. For 20 VPCs, attachment fees alone exceed $700 per month, though 20 managed attachments replace 190 peering links.
In production enterprise environments, the most common compromise is a hybrid approach: using TGW as the default backbone while layering VPC Peering between select high-volume VPC pairs.
By configuring a broad summary route toward TGW in the VPC route table (e.g., 10.0.0.0/8 TGW) alongside a specific route for a high-traffic peer (e.g., 10.2.0.0/16 Peering), you let Longest Prefix Match steer high-volume traffic through the direct peering link—avoiding TGW data processing fees while keeping centralized governance for everything else.
PrivateLink: Service-Boundary Exposure with Least Privilege
Both VPC Peering and TGW operate at Layer 3, interconnecting entire IP networks where all instances become reachable at the routing layer and perimeter security relies entirely on Security Groups. When you only need to expose a single application to a partner, customer, or internal team, AWS PrivateLink is the superior pattern.
With PrivateLink, the service provider places its application behind a Network Load Balancer (NLB) to create an Endpoint Service. The consumer then provisions an Interface Endpoint within its own VPC, creating an Elastic Network Interface (ENI) backed by a local private IP—effectively a dedicated virtual NIC inside the consumer’s VPC.
[ Consumer VPC: Local App (192.168.1.5) ]
|
v (AWS Internal Network)
[ Interface ENI ] --> [ NLB ] --> [ Provider VPC: App ]
PrivateLink offers three defining characteristics:
- Unidirectional Connectivity: Only consumers can initiate connections; providers cannot probe or traverse the consumer’s network.
- Overlapping CIDR Support: Consumers connect directly to a local ENI IP inside their own VPC, with traffic forwarded across AWS’s private backbone. Overlapping CIDR ranges between provider and consumer cause zero routing conflicts.
- Least-Privilege Exposure: instead of opening an entire subnet, it exposes only the specific ports behind the target NLB.
Cross-VPC Connectivity Patterns Compared
| Evaluation Dimension | VPC Peering | Transit Gateway | AWS PrivateLink |
|---|---|---|---|
| OSI Layer | Layer 3 (Network-wide interconnect) | Layer 3 (Network-wide interconnect) | Layer 4 (Single-service endpoint) |
| Directionality | Bidirectional | Bidirectional | Unidirectional (Consumer-initiated only) |
| CIDR Conflicts | Overlaps strictly prohibited | Overlaps strictly prohibited | Fully supports overlapping CIDRs |
| Topology | Point-to-point (Non-transitive) | Hub-and-spoke (Transitive) | Point-to-service endpoint |
| Cost Model | No hourly fee; free within same AZ | Hourly attachment fee + data processing fee | Hourly endpoint fee + data processing fee |
Hybrid Cloud Connectivity: VPN vs. Direct Connect Trade-offs and Failover
Connecting on-premises data centers to AWS typically relies on two options: Site-to-Site VPN (IPsec tunnels over the public internet) or Direct Connect (DX) (dedicated private physical circuits).
[ On-Premises DC ]
|
+--> Site-to-Site VPN (IPsec / Internet)
|
+--> Direct Connect (Dedicated Fiber)
|
v
[ Transit Gateway ]
Core Characteristics Compared
| Evaluation Dimension | Site-to-Site VPN | Direct Connect (DX) |
|---|---|---|
| Medium | Public Internet (IPsec encrypted) | Dedicated physical circuit (Bypasses internet) |
| Provisioning Time | Minutes | Weeks to months (Requires physical cross-connects) |
| Latency & Jitter | Subject to internet weather | Highly stable and deterministic |
| Encryption | Built-in IPsec | Unencrypted by default (MACsec on supported ports, or VPN over DX) |
| Cost Structure | Minimal hourly fee; ideal for low-to-medium traffic | High fixed port-hour fee; lower egress data transfer rates |
Active/Passive Architecture and Route Priority Traps
Mission-critical enterprise systems typically adopt Direct Connect as the primary path and Site-to-Site VPN as the backup. When both DX and VPN advertise identical prefixes via BGP (Border Gateway Protocol, the dynamic routing protocol that exchanges routing information automatically), AWS Transit Gateway evaluates routes according to its documented route evaluation order: routes propagated from a Direct Connect Gateway take precedence over routes propagated from a VPN. (A Direct Connect Gateway is the centralized routing component connecting dedicated circuits to multiple VPCs).
Under normal operations, traffic flows across Direct Connect; if the physical circuit drops, BGP failover shifts traffic to the VPN tunnel automatically.
The most common operational pitfall here is that static routes in a TGW route table take precedence over all dynamic BGP-propagated routes. If engineers mistakenly configure the backup VPN using static routes, those static entries will override DX’s dynamic routes even when DX is healthy, pinning all primary traffic to the VPN tunnel. Therefore, always configure backup VPNs using dynamic BGP routing.
Hybrid DNS: Resolving Cross-Network Names with Route 53 Resolver
Once cross-network routing is established, name resolution is the next hurdle. By default, Route 53 Resolver inside a VPC cannot answer queries originating from on-premises networks, nor can VPC workloads resolve internal on-premises domain names.
A DHCP Option Set specifies which DNS servers VPC instances query. If you modify the DHCP Option Set to point directly to on-premises DNS servers, instances will bypass the VPC’s built-in resolver (AmazonProvidedDNS, the resolver at the reserved .2 address in each subnet). This completely breaks internal name resolution for Route 53 Private Hosted Zones and PrivateLink.
The right approach is to deploy Route 53 Resolver Endpoints:
[ VPC Workloads ]
|
+-- [ Inbound Endpoint ]
| ^
| | (Query aws.internal)
| |
| [ On-Prem DNS ]
|
+-- [ Outbound Endpoint ]
|
| (Forward corp.local)
v
[ On-Prem DNS ]
- Inbound Endpoints: Provision ENIs with private IPs inside your VPC. On-premises DNS servers configure conditional forwarders to route cloud-hosted private domains (e.g.,
*.aws.internal) to these IP addresses. - Outbound Endpoints: Combined with Resolver forwarding rules, any VPC query destined for an internal corporate domain (e.g.,
*.corp.example.com) is automatically forwarded across the hybrid link to on-premises DNS servers.
Resolver forwarding rules can be shared across all AWS accounts via AWS RAM (Resource Access Manager). By deploying a single pair of Inbound and Outbound Endpoints in a centralized network account, you can serve the entire enterprise organization.
Multi-Account Governance: Shared VPC and IPAM
As organizations scale, a single AWS account cannot provide sufficient security and blast-radius isolation. However, allowing every account to create its own VPC leads to IP sprawl, CIDR overlaps, and fragmented network governance.
Shared VPC: Centralized CIDRs and Resource Isolation
VPC Sharing allows a central networking team to own and manage VPCs and subnets in an “owner account,” sharing specific subnets with application “participant accounts” via AWS RAM.
- Separation of Duties: Application teams launch EC2 instances, RDS databases, or Lambda functions inside shared subnets without permissions to alter subnet CIDRs, route tables, or Network ACLs (subnet-level stateless firewalls). The network team retains full control over routing and perimeter security.
- Cost Efficiency: Reduces overall VPC sprawl and minimizes required TGW attachments. Participants pay for their own computing resources and data transfer, while the network account centralizes fixed costs for NAT Gateways and routing infrastructure.
VPC IPAM: Automated CIDR Planning
IP Address Manager (IPAM) brings systematic structure to IP address management. By organizing hierarchical address pools at the AWS Organizations root (e.g., 10.0.0.0/8 Regional Pools Environment Pools), IPAM allocates non-overlapping CIDRs to new VPCs automatically from their designated pool, eliminating accidental IP conflicts at the source.
Centralized Egress Architecture and Security Inspection
In an organization with dozens of VPCs, deploying individual NAT Gateways in every Availability Zone of every VPC incurs substantial idle hourly charges. Centralized Egress consolidates NAT Gateways and Internet Gateways into a dedicated Egress VPC.
[ Spoke VPC 1 ] --+
|
[ Spoke VPC 2 ] --+--> [ Transit Gateway ]
|
[ Spoke VPC 3 ] --+ |
v
[ Egress VPC (NAT GW) ] --> Internet
All spoke VPCs direct their default outbound route (0.0.0.0/0) to the Transit Gateway, which forwards outbound traffic to the Egress VPC. This pattern significantly lowers NAT idle costs, concentrates the organization’s public egress onto a small set of predictable IPs (simplifying partner whitelisting and internal audits), and makes it easier to integrate AWS Network Firewall for centralized traffic filtering and deep packet inspection.
Starting in 2025, AWS Network Firewall supports native Transit Gateway Attachment integration. This eliminates the legacy requirement of routing traffic through a dedicated Inspection VPC before reaching its destination, substantially streamlining enterprise security topologies.
Real-World Architecture Evolution: Thresholds and Decision Triggers
As a growing company scales its cloud presence, its network typically evolves through five distinct stages, each driven by specific architectural tipping points:
Stage 1: Point-to-Point Peering (VPC Peering)
| (VPC sprawl drives full-mesh complexity)
Stage 2: Hub-and-Spoke Interconnect (TGW + Segmentation)
| (Multi-account expansion causes CIDR overlaps)
Stage 3: Multi-Account Governance (Shared VPC + IPAM
+ PrivateLink)
| (Integrating with on-premises data centers)
Stage 4: Hybrid Cloud Connectivity (Direct Connect + VPN
+ Resolver Endpoints)
| (Surging idle NAT costs & strict security compliance)
Stage 5: Centralized Security & Egress (Egress VPC + ANFW)
- When to migrate from VPC Peering to Transit Gateway: When VPC counts reach 5 to 10, manual route table maintenance becomes cumbersome, or multiple VPCs need to share a single Direct Connect link.
- When to adopt Shared VPC and IPAM: When autonomous teams in separate accounts carve out arbitrary CIDRs leading to address exhaustion or IP collisions, and network configurations diverge across environments.
- When to choose PrivateLink: When publishing a single service to external partners, customers, or SaaS platforms, especially where IP address spaces overlap or neither party should grant full L3 network reachability.
- When to integrate Direct Connect and Hybrid DNS: When the business needs stable, low-latency, high-bandwidth dedicated connectivity (DX) to on-premises systems—configured with a BGP-based VPN as failover—and Route 53 Resolver Endpoints to enable two-way internal domain resolution without breaking cloud-native DNS.
- When to deploy Centralized Egress and Inspection Firewalls: When idle NAT Gateway charges across dozens of VPCs become unsustainable, or security compliance mandates centralized deep packet inspection (DPI) on all internet-bound traffic.
Conclusion
Moving from a single VPC to multi-account and hybrid cloud architectures dramatically increases component counts, yet the foundational networking laws remain unchanged: routes are always determined by Longest Prefix Match, IP address planning must strictly prevent overlaps, cross-network communication starts with reliable name resolution, and data transfer costs reflect the exact path traversed.
By understanding the distinct pain points and inherent limitations of each building block, and upgrading in sequence as the architecture scales, you can build a modern cloud network that balances security, flexibility, and cost.