Cloud

VPC Peering vs Transit Gateway

Two ways to connect AWS VPCs: VPC peering is a direct, non-transitive 1-to-1 link — simple and cheap for a few VPCs. A Transit Gateway is a routed hub every VPC attaches to — the scalable answer once you have many. The decision is mesh maths.

Side by side

VPC PeeringTransit Gateway
Topology1-to-1 between two VPCsHub-and-spoke, many attachments
Transitive?No — A-B and B-C does not give A-CYes — everything via the hub
ScaleFull mesh grows as n(n-1)/2Thousands of VPCs/VPNs on one hub
CostData transfer onlyPer-attachment + data processing
Best forA few VPCsMany VPCs, hybrid, growth

The non-transitive trap

The exam-and-real-life gotcha: peering is not transitive. If A peers with B and B peers with C, A still cannot reach C — you must peer A–C directly. Ten VPCs in a full mesh need 45 peerings, each with route-table entries. That administrative explosion is exactly what the Transit Gateway removes.

How the Transit Gateway works

A TGW is effectively a regional cloud router: every VPC (and site-to-site VPN or Direct Connect) attaches once, and TGW route tables decide who reaches whom — hub-and-spoke, just like the hierarchical designs you know on-prem. You pay per attachment-hour plus data processing, which is the price of escaping mesh management.

Choosing in practice

2–4 VPCs, stable: peering — simpler and cheaper. Growing environment, hybrid connectivity, shared services: Transit Gateway from the start; retrofitting a mesh later hurts. Foundations first: AWS networking basics.

Frequently asked questions

What is the difference between VPC peering and Transit Gateway?

Peering is a direct, non-transitive connection between exactly two VPCs. A Transit Gateway is a central routed hub that many VPCs and VPNs attach to, with transitive routing between them.

Why is VPC peering non-transitive?

AWS designed peering as a strict 1:1 relationship — traffic cannot flow through an intermediate VPC. Any two VPCs that need to talk must be directly peered.

When should I use a Transit Gateway?

When you have (or expect) many VPCs, need hybrid connectivity via VPN or Direct Connect through one hub, or want centralised route control instead of managing a peering mesh.

Which is cheaper, peering or Transit Gateway?

Peering — it has no hourly charge, only data transfer. TGW adds per-attachment-hour and data-processing fees, which buy you scale and manageability.

VS
Vipul Sir — Lead Instructor, Attila Technologies20+ years in Cisco networking. Teaching CCNA, CCNP, CCIE & CyberOps in Ahmedabad since 2004.

Want hands-on training?

Learn this on real Cisco lab devices with placement support at Attila Technologies, Ahmedabad.

Start your networking career with Attila Technologies

Hands-on Cisco training, real lab devices and placement support in Ahmedabad.