Transit Gateway (TGW) is a network hub that connects thousands of VPCs and on-premises networks. Instead of creating VPC peering connections between every pair of VPCs (complex mesh), all VPCs connect to one central Transit Gateway.
WITHOUT Transit Gateway (VPC Peering Mesh):
10 VPCs = 45 peering connections
100 VPCs = 4,950 peering connections
Problem: Non-transitive, no central management
WITH Transit Gateway:
10 VPCs = 10 TGW attachments
100 VPCs = 100 TGW attachments
Central route table management
Supports transitive routing
[Transit Gateway]
|
+--------------+------------------+
| | |
VPC-Prod VPC-Dev Direct Connect
(App servers) (Development) (On-premises)
| | |
VPC-DB VPC-Staging VPN Connection
(Database) (Testing) (Backup path)
Transit Gateway uses route tables to control which VPCs can communicate with which. You can isolate environments (prod cannot talk to dev) while allowing all to reach shared services.
Route Table: Production
- Route to VPC-Prod: ALLOW
- Route to VPC-Shared-Services: ALLOW
- Route to VPC-Dev: DENY (not configured)
Route Table: Development
- Route to VPC-Dev: ALLOW
- Route to VPC-Shared-Services: ALLOW
- Route to VPC-Prod: DENY (isolation)