AWS Transit Gateway
AWS Transit Gateway for hub-and-spoke, transitive connections between thousands of VPCs and on premises, route tables, sharing with RAM, inter-Region peering, multicast, ECMP for VPN bandwidth, and sharing Direct Connect.
Why it exists
With a few VPCs, peering works. With dozens of VPCs, VPN connections and Direct Connect, a mesh of peerings and VPNs becomes impossible to manage: every pair needs its own connection, because peering isn't transitive.
What it is
AWS Transit Gateway gives transitive peering between thousands of VPCs and on premises, with a hub-and-spoke (star) connection.
- A Regional resource, which can work cross-Region.
- Share it cross-account using Resource Access Manager (RAM).
- Transit gateways can be peered across Regions.
- Route tables: limit which VPC can talk with which other VPC.
- Works with Direct Connect gateway and VPN connections.
- Supports IP multicast (not supported by any other AWS service).
Site-to-Site VPN ECMP
- ECMP = Equal-Cost Multi-Path routing: a routing strategy that forwards a packet over multiple best paths.
- Use case: create multiple Site-to-Site VPN connections to increase the bandwidth of the connection to AWS.
Throughput with ECMP:
- VPN to a virtual private gateway: 1 VPN connection (2 tunnels) = 1 VPC; 1.25 Gbps (only one tunnel is used).
- VPN to a transit gateway: 1 VPN connection reaches many VPCs, and ECMP uses both tunnels:
- 1 VPN = 2.5 Gbps;
- 2 VPNs = 5.0 Gbps;
- 3 VPNs = 7.5 Gbps.
- Billing is per GB of data processed by the transit gateway.
Share Direct Connect between accounts
A single Direct Connect connection can serve VPCs in many accounts: Direct Connect location → transit VIF → Direct Connect gateway → transit gateway, which is attached to VPCs in account 1, account 2… RAM is used to share the transit gateway with the other accounts.
Real-world examples
- A company with 80 VPCs in 20 accounts attaches them all to one transit gateway shared through RAM, with route tables keeping production and development apart, and one Direct Connect gateway for the data centers.
Exam tips
- "Connect many VPCs and on premises, transitive, hub-and-spoke" → Transit Gateway.
- "IP multicast" → Transit Gateway.
- "Increase VPN bandwidth beyond 1.25 Gbps" → several Site-to-Site VPNs to a transit gateway with ECMP.
- "Share one Direct Connect with many accounts' VPCs" → transit VIF + DX gateway + transit gateway shared with RAM.
- "Isolate some VPCs from others" → transit gateway route tables.
Common traps
- "Peering is transitive through a hub VPC." Only Transit Gateway gives transitive routing.
- "A VPN to a virtual private gateway uses ECMP." ECMP across tunnels and connections needs a transit gateway.
Check yourself
A transit gateway attachment costs about $0.05 an hour, so instead:
Create several Site-to-Site VPN connections to a transit gateway and enable ECMP: each VPN gives about 2.5 Gbps across its two tunnels, so two connections give about 5 Gbps.
AWS documentation
VPC endpoints and PrivateLink
VPC endpoints for private access to AWS services, interface endpoints (PrivateLink) vs gateway endpoints, choosing for S3, Lambda in a VPC reaching DynamoDB, and PrivateLink endpoint services.
Site-to-Site VPN and Client VPN
AWS Site-to-Site VPN with a virtual private gateway and customer gateway, route propagation, tunnels and bandwidth, VPN CloudHub for many sites, and AWS Client VPN for users.