🐾VPC peering vs AWS Transit Gateway🐾
🤓 When connecting AWS VPCs, many teams jump straight to using Transit Gateway without considering VPC Peering as an option. While Transit Gateway is powerful and handles complex networking scenarios, it's also more expensive. VPC Peering is often the better choice for basic VPC-to-VPC connections, especially when you just need a few VPCs to talk to each other. Don't let the simplicity fool you – sometimes the straightforward solution is exactly what you need.
VPC Peering
🔹Transitive routing is not supported, so if you have 4 VPCs and want to connect them, you should establish 6 VPC Peering connections.
🔹You cannot access resources using Direct Connect, Internet Gateway, NAT Gateway, or Gateway endpoints hosted in peered VPC.
🔹You cannot connect to or query the Amazon DNS server in a peer VPC.
🔹You can have up to 125 peering connections per VPC.
💰VPC peering connections are provided at no additional cost, you are charged only for cross-AZs or cross-region traffic.
You can read about VPC peering limitations in more detail here.
Transit Gateway
🔹Transitive routing is supported, all VPCs that are connected to Transit Gateway can connect each other resources.
🔹You can have up to 5,000 Attachments per Region.
💰You will pay $365 for 10 attachments not including the price of processed traffic.
Use cases
VPC Peering:
Only several VPCs should be connected, so the overhead of connecting them with VPC peering is acceptable.
You don't need connections between all VPCs. For example, you have one VPC with some resources that should be shared, and you only need to connect all other VPCs to it.
You are limited on budget and can accept set-up overhead.
Transit Gateway:
You have a large number of VPCs that should be interconnected.
You know that the number of VPCs will grow in the future.
Thank you for reading, let’s chat 💬
💬 Which option do you use for your workloads?
💬 Have you used this option from the start?
💬 Any other use cases for VPC peering or Transit Gateway?
I love hearing from readers 🫶🏻 Please feel free to drop comments, questions, and opinions below👇🏻