What You Will Learn
Advanced
- What VPC peering is
- Transit Gateway for complex topologies
- When to use each
VPC Peering connects two VPCs so they can communicate as if they are the same network. Transit Gateway is a hub-and-spoke model for connecting many VPCs.
| Aspect | VPC Peering | Transit Gateway |
|---|---|---|
| Connections | 1-to-1 | Many-to-many |
| Transitivity | No (A-B, B-C != A-C) | Yes |
| Cost | Free | $$ per attachment |
| Best for | 2 VPCs | 3+ VPCs |
Practical Exercise
Create two VPCs in different CIDR ranges
Create a VPC peering connection between them
Update route tables to route through the peering
Test: EC2 in VPC-A pings EC2 in VPC-B
Key Takeaways
- VPC Peering: 1-to-1 VPC connection. Free.
- Transit Gateway: hub-and-spoke for many VPCs.
- Peering is NOT transitive (A-B-C does not connect A-C).
- Transit Gateway IS transitive.
- Use peering for 2 VPCs, Transit Gateway for 3+.
Comments
Comments
Post a Comment