5.2 VPC Connectivity — Peering, Transit Gateway, and Direct Connect

Key Takeaways

  • VPC peering connects two VPCs privately with no single point of failure, but it is NOT transitive — each pair needs its own peering connection.
  • AWS Transit Gateway is a hub-and-spoke network that connects thousands of VPCs, on-premises networks, and other Transit Gateways with centralized routing.
  • AWS Direct Connect provides a dedicated private network connection from on-premises to AWS with consistent low latency and high bandwidth.
  • AWS Site-to-Site VPN provides encrypted connectivity over the public internet — faster to set up than Direct Connect but with variable performance.
  • For many VPCs (>3-4), Transit Gateway is more cost-effective and manageable than full-mesh VPC peering.
Last updated: March 2026

VPC Connectivity — Peering, Transit Gateway, and Direct Connect

Quick Answer: VPC Peering = simple, free data transfer within same AZ, no transitive routing. Transit Gateway = hub connecting thousands of VPCs and on-premises (transitive). Direct Connect = dedicated private link (1-100 Gbps, consistent latency). Site-to-Site VPN = encrypted tunnel over internet (quick setup, variable performance).

VPC Peering

VPC Peering creates a private network connection between two VPCs.

FeatureDetail
Transitive?NO — each pair needs its own peering connection
Cross-RegionYes (inter-Region peering)
Cross-AccountYes
CIDR overlapCannot peer VPCs with overlapping CIDR blocks
CostFree within same AZ; cross-AZ/cross-Region incurs data transfer charges
BandwidthNo bandwidth limit

VPC Peering Limitations

The main limitation is that peering is NOT transitive:

  • If VPC-A peers with VPC-B, and VPC-B peers with VPC-C, VPC-A cannot talk to VPC-C through VPC-B
  • For full connectivity, VPC-A must also peer directly with VPC-C
  • This becomes unmanageable with many VPCs (n VPCs need n*(n-1)/2 peering connections)

AWS Transit Gateway

Transit Gateway is a network transit hub that connects VPCs, on-premises networks, VPN connections, and other Transit Gateways.

FeatureDetail
ConnectivityHub-and-spoke model — all VPCs connect to Transit Gateway
TransitiveYES — all attached networks can communicate through Transit Gateway
ScaleThousands of VPCs per Transit Gateway
Cross-RegionTransit Gateway peering between Regions
Cross-AccountShare via AWS RAM (Resource Access Manager)
BandwidthUp to 50 Gbps per attachment
Route tablesMultiple route tables for segmentation
CostPer hour per attachment + per GB data processed

When to Use Transit Gateway vs. VPC Peering

ScenarioBest Option
2-3 VPCs that need to communicateVPC Peering (simpler, cheaper)
10+ VPCs needing communicationTransit Gateway (hub-and-spoke)
VPCs + on-premises connectivityTransit Gateway + VPN/Direct Connect
Simple point-to-point connectionVPC Peering
Complex routing, segmentationTransit Gateway with route tables

AWS Direct Connect

Direct Connect provides a dedicated, private network connection from your premises to AWS.

FeatureDetail
Bandwidth1 Gbps, 10 Gbps, or 100 Gbps (dedicated connections)
Hosted connectionsSub-1 Gbps through partners (50 Mbps - 10 Gbps)
LatencyConsistent, lower than internet
EncryptionNOT encrypted by default (add VPN on top for encryption)
Setup timeWeeks to months (physical connection)
RedundancySingle connection = single point of failure; use 2 connections for HA
Virtual InterfacesPublic VIF (AWS public services), Private VIF (VPC), Transit VIF (Transit Gateway)

Direct Connect + VPN for Encryption

Direct Connect traffic is private but NOT encrypted. For encryption:

  1. Establish Direct Connect connection
  2. Create a VPN connection over the Direct Connect link
  3. This provides both the bandwidth/consistency of Direct Connect AND encryption

AWS Site-to-Site VPN

FeatureDetail
EncryptionIPsec encrypted tunnel
OverPublic internet
Setup timeMinutes (software configuration)
BandwidthUp to 1.25 Gbps per tunnel (2 tunnels per connection)
LatencyVariable (internet routing)
Cost$0.05/hour per VPN connection + data transfer
HATwo tunnels to different AZs

Connectivity Comparison

FeatureVPC PeeringTransit GatewayDirect ConnectSite-to-Site VPN
TypeVPC-to-VPCHub-and-spokeDedicated linkIPsec over internet
TransitiveNoYesN/AN/A
BandwidthUnlimited50 Gbps/attachment1-100 Gbps1.25 Gbps/tunnel
SetupMinutesMinutesWeeks-monthsMinutes
EncryptedYes (in-transit)Yes (in-transit)No (add VPN)Yes (IPsec)
CostData transfer onlyPer attachment + dataPort fee + dataPer hour + data

On the Exam: "Connect 50 VPCs and on-premises with centralized routing" → Transit Gateway. "Dedicated private connection with consistent latency" → Direct Connect. "Quick encrypted connection to AWS" → Site-to-Site VPN.

Test Your Knowledge

A company has 20 VPCs that all need to communicate with each other and with an on-premises data center. Which networking solution provides the SIMPLEST architecture?

A
B
C
D
Test Your Knowledge

A company needs a dedicated, private network connection from their data center to AWS with consistent low latency. What should they use?

A
B
C
D
Test Your Knowledge

AWS Direct Connect does NOT provide encryption by default. How can you add encryption to a Direct Connect connection?

A
B
C
D