After connecting our 40th VPC with peering relationships three years ago, my team spent an entire weekend untangling asymmetric routes and overlapping CIDRs during a regional failover that never should have been complicated. That incident forced us to completely rethink how we interconnect private networks on AWS. If you run more than a handful of VPCs, you quickly learn that VPC peering, Transit Gateway, and PrivateLink are not interchangeable options on a menu — they solve fundamentally different problems, fail in different ways, and impose very different operational taxes. In this article I will break down how each service actually forwards traffic, where I have seen them break in production, and how to choose and combine them without building a topology you will regret at 2 AM.
The Connectivity Tax: Why Your VPC Topology Dictates Operational Toil
Every VPC interconnect decision creates recurring work. In my experience, teams underestimate this tax because the initial setup for any of these services looks deceptively simple in the console. The real cost shows up in route table management, DNS resolution, blast radius control, and the inevitable IP address collisions six months later.
A common starting point is a handful of application VPCs peered to a shared services VPC that hosts Active Directory, CI/CD runners, or a logging stack. With three or four VPCs, vpc peering feels lightweight: no extra hourly charges, no bandwidth surcharge, and latency is essentially that of the underlying AWS fabric. The problem is the relationship is 1:1, non-transitive, and managed per route table. Add a fifth VPC and you are maintaining ten potential peering connections if you want full mesh. Add a sixth and it is fifteen. The number of peering connections scales as n*(n-1)/2, and each one requires an accepter, route entries in every involved subnet's route table, and security group reference updates.
This is where a disciplined IP addressing strategy becomes non-negotiable. I have inherited environments where teams used 10.0.0.0/16 everywhere and then tried to peer — AWS simply blocks peering with overlapping CIDRs, and rightly so. Before you choose any interconnect, allocate from a centrally managed partition. When we adopted a Multi-Account AWS Strategy: Landing Zones, Control Tower and Organization Units, we moved to a /16 per workload family, carved into /20s or /21s per VPC with 20% headroom reserved for expansion. That upfront planning eliminated the renumbering project that had previously consumed two sprints.
How I Decide What “Tax” Is Acceptable
I evaluate three dimensions: number of route table edits per new VPC, number of places DNS must be configured, and whether a network change can cause a regional outage. VPC peering is cheap on bills but expensive on human edits. Transit Gateway centralizes routing but introduces a new regional control plane you must version, monitor, and share correctly. PrivateLink eliminates routing entirely for a specific service but requires a per-interface endpoint and DNS alias. For fewer than 6-8 VPCs with stable CIDRs and no need for transitive routing, peering can still be rational. Beyond that, the human error rate outweighs the infrastructure savings.
VPC Peering Under the Hood: Non-Transitive Routing and Hidden Limits
VPC peering creates a direct, point-to-point network path at the AWS hypervisor layer. No gateway, no hop, no single point of congestion. Packets are encapsulated and forwarded as if the two VPCs were locally connected. That is why throughput is limited only by instance and placement — you can push 50-100 Gbps between enhanced networking instances without throttling from the peering itself — and latency is consistently sub-millisecond intra-AZ.
The catch is that peering is strictly non-transitive. If VPC A is peered to VPC B, and VPC B is peered to VPC C, A cannot talk to C through B. In one SaaS environment we supported, the data platform team assumed their ETL runners in VPC B could transit traffic from frontend VPC A to data lake VPC C. They could not. We had to create a direct peering A-C or redesign around a transit hub. There is no route trick to make it transitive; AWS drops traffic that would require a second peering hop.
Other limits materialize at scale. Per VPC you can have up to 50 active peering connections by default (soft limit, increasable to 125), but the more painful limit is 50 routes per route table entry toward peering connections unless you use prefix lists. Security group referencing works across peered VPCs, but only within the same region and only if you reference the peered security group ID correctly — stale references after VPC deletion will silently block traffic and not show up in VPC Flow Logs as rejected, just as no route.
When VPC Peering Still Wins
I still recommend vpc peering for two specific patterns: high-volume, low-latency replication between exactly two VPCs (for example, cross-VPC Aurora or ElastiCache Global Datastore replication), and temporary migration paths during data center evacuation where you need minimal overhead for a few weeks. In those cases, the lack of hourly charges and bandwidth markups matters.
# Minimal but production-ready peering with Terraform
# See Terraform Documentation for provider details
resource "aws_vpc_peering_connection" "app_to_shared" {
vpc_id = aws_vpc.app.id
peer_vpc_id = aws_vpc.shared_services.id
peer_region = "us-east-1"
auto_accept = false
tags = { Name = "app-to-shared" }
}
resource "aws_vpc_peering_connection_accepter" "peer_accepter" {
vpc_peering_connection_id = aws_vpc_peering_connection.app_to_shared.id
auto_accept = true
tags = { Side = "accepter" }
}
resource "aws_route" "app_to_shared" {
for_each = toset(data.aws_route_tables.app.ids)
route_table_id = each.value
destination_cidr_block = aws_vpc.shared_services.cidr_block
vpc_peering_connection_id = aws_vpc_peering_connection.app_to_shared.id
}
For cross-region peering, be explicit about MTU and encryption. Inter-region peering traffic runs over the AWS backbone, encrypted, but with higher baseline latency (e.g., 65-75ms us-east-1 to eu-west-1) and a data transfer charge that is distinct from Transit Gateway pricing. I've found that enabling jumbo frames (9001 MTU) helps for replication workloads, but you must verify end-to-end with ping -M do -s 8972.
Transit Gateway as a Regional Router: Building a Hub That Does Not Become a Single Point of Failure
Transit Gateway (TGW) is not a bigger peering connection. It is a managed, highly available regional router that decouples VPC attachment from routing policy. Each VPC attaches via an elastic network interface in each AZ you enable, and TGW maintains separate route tables that control which attachments can reach which CIDRs. This indirection is powerful because it makes transitive routing intentional.
In our platform, we run one TGW per region, shared via AWS Resource Access Manager (RAM) to workload accounts. The TGW has three route tables: production, non-production, and isolated. A new VPC attachment is associated with one table and propagates only to that table. By default, production cannot route to isolated, and non-production cannot reach production without explicit routes. That segmentation would have required hundreds of peering connections and NACLs to approximate.
Throughput is the area where assumptions hurt you. A TGW attachment itself does not enforce a bandwidth cap, but each Availability Zone attachment is limited to 50 Gbps burst, and the TGW overall scales horizontally by adding AZs. If you attach a VPC in only two AZs and push 80 Gbps of inter-VPC traffic, you will see drops. I always attach in at least three AZs for data-heavy VPCs and use CloudWatch metrics TransitGatewayBytesIn/Out per attachment to detect black-holing early. Unlike peering, TGW adds a small latency hop — typically 1-2ms — and a per-GB processing fee (currently $0.02/GB in us-east-1) on top of standard inter-AZ charges.
Route Tables, Propagation, and the Mistake Everyone Makes
The most common mistake I have seen is enabling route propagation from all attachments into a single TGW route table and calling it a mesh. That recreates the peering problem at the hub: overlapping CIDRs collide, a misbehaving VPC can advertise a more specific route and hijack traffic, and troubleshooting becomes a hunt through a single massive table.
Instead, treat TGW route tables as security boundaries. Here is a pattern we use for centralized egress:
resource "aws_ec2_transit_gateway" "main" {
description = "regional hub"
amazon_side_asn = 64512
auto_accept_shared_attachments = "enable"
default_route_table_association = "disable"
default_route_table_propagation = "disable"
}
resource "aws_ec2_transit_gateway_route_table" "prod" {
transit_gateway_id = aws_ec2_transit_gateway.main.id
tags = { Purpose = "prod" }
}
resource "aws_ec2_transit_gateway_vpc_attachment" "app_prod" {
subnet_ids = aws_subnet.app_prod[*].id
transit_gateway_id = aws_ec2_transit_gateway.main.id
vpc_id = aws_vpc.app_prod.id
transit_gateway_default_route_table_association = false
transit_gateway_default_route_table_propagation = false
}
resource "aws_ec2_transit_gateway_route_table_association" "app_prod_assoc" {
transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.app_prod.id
transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.prod.id
}
resource "aws_ec2_transit_gateway_route_table_propagation" "app_prod_prop" {
transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.app_prod.id
transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.prod.id
}
Note the explicit disablement of default association/propagation. This forces intentionality. If you leave defaults enabled, a newly attached VPC automatically propagates, which once caused a non-prod 10.1.0.0/16 to shadow a prod 10.1.128.0/17 because longest-prefix matching was misunderstood during an emergency attachment. Disabling defaults and using Infrastructure as Code reviewed via pull request prevents that class of error. For state management of that code, follow the guidance in the Terraform Documentation on remote state and locking.
For multi-region architectures, peer Transit Gateways together. TGW peering propagates routes between regional route tables, which is far cleaner than meshing VPCs across regions. I keep inter-region TGW peering attachments in their own route table and only propagate summarized aggregates (e.g., 10.100.0.0/16 for us-east-1, 10.200.0.0/16 for eu-west-1) to keep the table under the 10,000 route limit and to limit blast radius.
PrivateLink: Exposing Services Without Merging Networks
PrivateLink solves a different problem entirely. It does not connect networks; it injects an elastic network interface (Interface VPC Endpoint) for a specific service into your VPC. Traffic to that service never leaves the AWS network, never traverses the internet, and never requires route table entries for CIDRs, NAT gateways, or internet gateways. The service consumer and provider VPCs can even have overlapping CIDRs because they never route to each other.
This distinction is critical when you expose a service to third parties or to many internal consumers. With peering or transit gateway, you are granting network-level reachability. With privatelink, you are granting application-level reachability to a single NLB/GWLB-backed service. In our setup, the central data API — an internal NLB fronting EKS pods — is exposed via an Endpoint Service (com.amazonaws.vpce.svc-xxxxx) and consumed by 30+ workload VPCs as interface endpoints. None of those VPCs can see each other's CIDRs, which is exactly the isolation we want.
Implementation details matter. An Interface Endpoint creates ENIs in the subnets you choose, each consuming a private IP and a security group. DNS is the lynchpin: if you enable Private DNS, AWS overrides the public DNS name for the service (e.g., s3.amazonaws.com or your custom vpce-svc name) to resolve to the endpoint ENIs inside the VPC. If you forget to enable private DNS or do not configure your own Route 53 private hosted zone alias, clients will resolve to public IPs and either fail or hairpin over NAT. I have debugged this twice where Lambda in a VPC could not reach the endpoint because the function's security group lacked egress to the endpoint's security group on 443.
# Provider side: expose an NLB via PrivateLink
resource "aws_vpc_endpoint_service" "data_api" {
acceptance_required = true
network_load_balancer_arns = [aws_lb.data_api_nlb.arn]
allowed_principals = ["arn:aws:iam::123456789012:root"]
}
# Consumer side: create interface endpoint
resource "aws_vpc_endpoint" "data_api_consumer" {
vpc_id = aws_vpc.consumer.id
service_name = aws_vpc_endpoint_service.data_api.service_name
vpc_endpoint_type = "Interface"
subnet_ids = aws_subnet.consumer_private[*].id
security_group_ids = [aws_security_group.vpce_access.id]
private_dns_enabled = true
}
Advanced Patterns and Limits
PrivateLink is unidirectional by design: consumers initiate to the provider's NLB; the provider cannot initiate back to the consumer. If you need bidirectional, you need two Endpoint Services. Also, each interface endpoint costs hourly per AZ plus per-GB processing. For a high-throughput service consumed in 3 AZs, that can exceed $150/month before data charges, whereas TGW might be cheaper for bulk data. I use PrivateLink when the consumer count is high, CIDR overlap is likely, and access must be limited to a single service or AWS managed service (S3 Gateway endpoints are free and should always be used). For bulk VPC-to-VPC subnet routing, TGW remains more economical.
Integration with Kubernetes is worth calling out. When EKS pods need to consume a PrivateLink service, ensure CoreDNS in the cluster forwards correctly and that the VPC CNI security groups allow pod-to-ENI traffic. The Kubernetes Documentation on DNS and services is useful when debugging why a pod resolves an endpoint name differently than an EC2 instance in the same VPC — often it is a search domain or ndots setting.
Cost, Latency and Throughput: Modeling the Real Price Before You Commit
Published prices rarely reflect your actual bill because data transfer and hourly charges compound differently. I model three components per gigabyte: intra-AZ transfer (usually $0.01), inter-AZ transfer ($0.01-$0.02), and service processing.
VPC peering within the same region has no processing fee. Inter-AZ peering still incurs the $0.01/GB inter-AZ charge, but intra-AZ is free. Transit Gateway adds $0.02/GB processing in each direction for traffic that traverses the TGW, plus the $0.05/hour per attachment (though TGW attachments shared via RAM charge only in the owner account). PrivateLink interface endpoints charge $0.01-$0.015/hour per AZ per endpoint plus $0.01/GB processed. Gateway endpoints for S3 and DynamoDB remain free and should be your default for those services.
Latencies differ subtly. Intra-region peering adds essentially zero hop latency. TGW adds a router hop — expect p50 increase of 0.8-1.5ms. PrivateLink via NLB adds NLB processing plus endpoint ENI: typically 1-3ms extra versus direct VPC routing. For real-time trading or high-frequency telemetry where every millisecond matters, I keep peered paths for that specific low-latency lane and use TGW for everything else.
A worked example from last quarter: 20 TB/month of inter-VPC traffic between 8 VPCs. With full mesh peering, cost was ~$200 in inter-AZ charges. With TGW hub, cost was ~$200 inter-AZ + ~$400 TGW processing = $600, but we eliminated 28 peering connections and hundreds of route entries, reducing change failure rate from 12% to near zero. The $400 was easily justified against two avoided incidents. Your threshold will differ — model it with your actual AZ distribution.
Failure Domains and Security Boundaries: Designing for Containment
From a Well-Architected perspective, the choice directly affects resilience and security posture. VPC peering has no central component to fail, but its failure domain is configuration drift. A single incorrect route propagation in a peered mesh can create asymmetric routing where return traffic takes a different path and gets dropped by stateful firewalls. I always enable VPC Flow Logs with rejection logging and run periodic reachability analysis using VPC Reachability Analyzer after any route change.
Transit Gateway is a regional managed service with 99.99% SLA, deployed redundantly per AZ, but it is still a logical single control plane. If you deploy a single TGW in a region and misconfigure its main route table, you can isolate every attached VPC at once. I mitigate this by using separate route tables per environment, keeping the default route tables disabled, versioning TGW config in Terraform, and applying service control policies that prevent modification of TGW attachments except through a pipeline role. This aligns with the operational excellence and reliability pillars described in the AWS Well-Architected Framework: Applying the Five Pillars in Practice.
PrivateLink offers the strongest isolation because no IP routing is shared. Endpoint policies allow you to restrict which actions can be invoked (for AWS services) and security groups on the endpoint ENIs restrict who can connect. Even if a consumer VPC is compromised, the attacker only gains access to the specific service, not the provider's network. For SaaS providers, requiring acceptance and verifying principal ARNs prevents unauthorized endpoint creation — a control we audit quarterly.
For logging, treat each differently. Peering and TGW traffic is visible in VPC Flow Logs with action ACCEPT/REJECT and can be sampled. PrivateLink data plane logs are not exposed as flow logs; you must rely on NLB access logs and endpoint CloudWatch metrics (ActiveConnections, BytesProcessed). I export all of these to a central security lake via an isolated logging VPC attached to TGW in its own route table to avoid mixing audit traffic with workload traffic.
| Attribute | VPC Peering | Transit Gateway | PrivateLink (Interface Endpoint) |
|---|---|---|---|
| Topology | Point-to-point, non-transitive mesh | Hub-and-spoke regional router, transitive via route tables | Service-level ENI, no network merging |
| Overlapping CIDRs | Not allowed | Not allowed for routed VPCs | Allowed — networks never route |
| Throughput | Line rate of instances, no service cap | 50 Gbps per AZ per attachment, scales with AZ count | 10 Gbps per ENI, scales with endpoint AZ count |
| Latency overhead | ~0 ms added | ~1-2 ms per TGW hop | ~1-3 ms via NLB/ENI |
| Cost model | No hourly/processing fee; only inter-region transfer | $0.05/hr per attachment + $0.02/GB processed | $0.01/hr per AZ + $0.01/GB processed; Gateway endpoints free |
| Best fit | 2-6 VPCs, high-volume direct paths, temporary links | 6+ VPCs, multi-account, centralized egress/inspection | Exposing single service/API to many consumers, overlapping IP, third-party SaaS |
Frequently Asked Questions
Can I use VPC Peering and Transit Gateway together in the same region?
Yes, and I often do. Keep high-volume, latency-sensitive pairs on direct peering while routing the rest through Transit Gateway. Just ensure their CIDRs do not overlap with TGW-propagated routes and that route tables do not create asymmetric paths. Document which pairs are peered and why, otherwise the next engineer will assume everything routes via TGW and be surprised by missing metrics.
How do I handle DNS when consuming a PrivateLink service from many VPCs?
Enable Private DNS on the interface endpoint so the service's default DNS name resolves to the endpoint ENIs inside each consumer VPC. If you need a custom name, create a Route 53 private hosted zone (e.g., api.internal.example.com) associated with all consumer VPCs and alias it to the endpoint DNS name. Verify resolution from both EC2 and pods — EKS CoreDNS caching can mask a misconfigured zone for minutes.
Does Transit Gateway support transitive routing to on-premises via Direct Connect or VPN?
Yes. Attach your Direct Connect gateway or VPN to the same Transit Gateway and propagate on-premises routes into the appropriate TGW route table. This is the cleanest way to give many VPCs access to on-premises without per-VPC VPNs. Use summarization for on-premises prefixes and filter propagation per route table so only authorized environments can reach the corporate network.
When should I prefer a Gateway Endpoint over an Interface Endpoint for S3 or DynamoDB?
Always prefer Gateway Endpoints for S3 and DynamoDB when available — they are free, scale automatically, and are configured via route tables rather than ENIs. Use Interface Endpoints for S3 only if you need PrivateLink features like access from on-premises over Direct Connect, cross-region access, or endpoint policies that require interface endpoint semantics.