VPC Peering vs Transit Gateway

~10 min read

Two ways to connect multiple VPCs — direct point-to-point versus a central routing hub.

VPC Peering creates a direct, point-to-point network connection between exactly two VPCs (same or different AWS accounts, same or different Regions). It's simple to set up and has no additional hourly cost (only data transfer charges apply), but it doesn't support transitive routing — if VPC A is peered with B, and B is peered with C, A still cannot reach C through B; you'd need a separate, explicit A-to-C peering connection.

As the number of VPCs needing to communicate grows, the number of peering connections needed grows quadratically (a full mesh of N VPCs needs N×(N-1)/2 peering connections), which becomes operationally unmanageable. Transit Gateway solves this by acting as a central hub: every VPC (and on-premises network via VPN or Direct Connect) attaches to the Transit Gateway once, and the Transit Gateway routes traffic between all attached networks according to route tables you define on the gateway itself — turning what would be a full mesh into a simple hub-and-spoke model.

Transit Gateway has an hourly cost per attachment plus data processing charges, and is overkill for a simple 2-VPC connection — the decision point is typically 'more than 3-4 VPCs needing to interconnect' or 'need to connect on-premises to multiple VPCs' as the trigger to move from peering to Transit Gateway.

💬 Deep Dive with AI

Key points

  • •VPC Peering: point-to-point, no transitive routing, no hourly cost, simple for a handful of VPCs
  • •Transit Gateway: central hub, transitive routing across all attachments, hourly + data cost, scales to dozens of VPCs and on-premises connections
  • •Peering connections needed for a full mesh grow quadratically with VPC count — the practical trigger to switch to Transit Gateway
  • •Transit Gateway route tables give fine-grained control over which attached networks can reach which others