2025-11-20
Amazon VPC: Multi-VPC and Hybrid Connectivity Solutions (Part 3)
AWSVPCNetworkingTransit GatewayVPNDirect Connect
A
<h2>Introduction</h2>
<p>In this third part of our Amazon VPC series, we explore the connectivity options available when you need to connect multiple VPCs or establish hybrid connectivity between AWS and your on-premises data centers.</p>
<p>As your cloud footprint grows, managing network traffic between isolated environments becomes critical. AWS provides several services to handle this complexity.</p>
<h2>How Many VPCs Do You Need?</h2>
<p>Initially, you might start with a single VPC. However, as teams grow and environments (Dev, Test, Prod) separate, you will likely end up with multiple VPCs across different accounts. Connecting these isolated networks requires specific strategies.</p>
<h2>VPC Peering</h2>
<p>VPC Peering is the simplest way to connect two VPCs. It establishes a direct network connection using private IP addresses. Instances in either VPC can communicate as if they are within the same network.</p>
<h3>Key Characteristics:</h3>
<ul>
<li><strong>Non-Transitive:</strong> If A is connected to B, and B to C, A cannot talk to C.</li>
<li><strong>Low Latency:</strong> Traffic stays on the AWS global backbone.</li>
<li><strong>No Overlapping CIDRs:</strong> You cannot peer VPCs with matching IP ranges.</li>
</ul>
<p>While effective for small setups, managing a mesh of peering connections becomes complex as the number of VPCs grows (N*(N-1)/2 connections).</p>
<h3>Terraform Example: Creating a VPC Peering Connection</h3>
<pre><code class="language-hcl">
resource "aws_vpc_peering_connection" "example" {
peer_owner_id = var.peer_owner_id
peer_vpc_id = aws_vpc.peer.id
vpc_id = aws_vpc.main.id
auto_accept = true
tags = { Name = "VPC Peering between Main and Peer" } } </code></pre>
<h2>AWS Transit Gateway</h2> <p>For larger scale networks, <strong>AWS Transit Gateway</strong> acts as a cloud router. It simplifies your network topology by allowing you to connect VPCs and on-premises networks through a central hub.</p> <p>Unlike peering, Transit Gateway <strong>is transitive</strong>. If VPC A and VPC B are both attached to the Transit Gateway, they can route traffic to each other (subject to routing tables).</p> <h2>Client VPN</h2> <p>AWS Client VPN allows individual users to securely connect to AWS resources from anywhere. It uses OpenVPN-based clients and supports authentication via Active Directory, SAML, or certificates.</p> <h2>Site-to-Site VPN</h2> <p>AWS Site-to-Site VPN creates secure IPsec tunnels between your on-premises network and your Amazon VPC. It utilizes the public internet, so while encrypted, performance can vary.</p> <p>This is often the first step in hybrid connectivity before moving to dedicated lines.</p> <h2>Direct Connect</h2> <p>AWS Direct Connect provides a dedicated physical connection between your network and AWS. It bypasses the public internet entirely.</p> <ul> <li><strong>Consistent Performance:</strong> Dedicated bandwidth (50 Mbps to 100 Gbps).</li> <li><strong>Cost Savings:</strong> Lower data transfer rates compared to internet egress.</li> <li><strong>Security:</strong> Traffic remains private.</li> </ul> <h2>Summary</h2> <p>Choosing the right connectivity option depends on your scale and requirements. VPC Peering is great for simple, high-speed links. Transit Gateway solves complexity at scale. VPNs provide quick hybrid access, while Direct Connect offers enterprise-grade reliability.</p> <h2>FAQ</h2> <h3>What is the difference between VPC Peering and Transit Gateway?</h3> <p>VPC Peering is a direct 1:1 connection and is non-transitive. Transit Gateway is a hub-and-spoke model that supports transitive routing and simplifies managing hundreds of VPCs.</p> <h3>Is data transfer over VPC Peering free?</h3> <p>No, data transfer charges apply for traffic crossing peered VPCs, especially if they are in different Availability Zones or Regions.</p> <h3>Can I use Direct Connect as a backup for VPN?</h3> <p>Usually, it's the other way around. Site-to-Site VPN is often used as a cost-effective backup for a Direct Connect link.</p> <p><em>Source: <a href="https://awsfundamentals.com/blog/amazon-vpc-introduction-part-3" target="_blank" rel="noopener noreferrer">https://awsfundamentals.com/blog/amazon-vpc-introduction-part-3</a></em></p>