0%
AWS in Practice: Services, Limits, and Failure Modes
Account Foundations
Compute
Storage
Databases
Delivery and Visibility
Limits, Cost and Recovery
PrivateLink, Peering, and Transit Gateway
Once an organisation has more than one VPC, it needs ways to connect them, and AWS offers several with very different properties. VPC peering connects two VPCs directly. Transit Gateway connects many VPCs and on premises networks through a central hub. PrivateLink exposes a single service from one VPC to consumers in others without connecting the networks at all. Choosing among them shapes routing, security, cost and how the network grows over years, and many organisations use all three for different purposes. This lesson starts with the simplest, peering.
It helps to name the three questions every connectivity choice answers. Which networks or services must reach which others, and in which direction? How much traffic flows, and how sensitive is it to latency and per gigabyte cost? And who owns each side, since a connection between two teams in one account is a very different conversation from one between a company and its customers. The answers rarely point to one option for the whole organisation, which is why mature AWS networks combine several, each chosen for a specific relationship rather than applied everywhere by habit.
How peering works
A VPC peering connection links two VPCs so that resources in each can reach the other using private addresses, as if they were on the same network. The VPCs can be in the same account or different accounts, and in the same region or different regions. One side requests the connection and the other accepts it, then each side adds routes in its route tables sending the other VPC's CIDR to the peering connection, and security groups on each side allow the traffic. There is no gateway or appliance in the path, so peering adds no bandwidth bottleneck and no single point of failure.
Peering traffic stays on the AWS network, including between regions, and is encrypted between regions. Within a region and zone, peering traffic has no data processing charge, only the normal cross zone transfer when it crosses zones, which makes peering the cheapest way to connect two VPCs that exchange large volumes. Security group rules can reference groups in a peered VPC in the same region, which keeps tier based access working across the connection. DNS resolution across the peering can be enabled so that public hostnames of resources in the other VPC resolve to private addresses.
Peering connections have a lifecycle worth knowing. A request sits pending acceptance for a week and then expires, so cross account peerings need the accepting team to act promptly. Once active, a peering can be deleted by either side at any time, which immediately breaks traffic, and nothing warns the other side beyond the routes turning into blackholes. Teams that rely on a peering owned by another account should alarm on its state through EventBridge or AWS Config, and treat the peering as shared infrastructure with an owner, a change process and documentation, not as a quiet link someone created once.
Route tables on each side decide which subnets can use the peering. A route for the peer's whole CIDR in every route table gives full reachability, while routes in only the application subnets' tables limit it to those subnets, and routes for a narrower prefix, such as one database subnet, limit it further. This is a useful first layer of control before security groups. A common mistake is adding the route on one side only: packets reach the peer, but replies have no route back, and the connection hangs in a way that looks like a firewall problem.
No transitive routing
Peering is strictly point to point. If VPC A peers with B, and B peers with C, A cannot reach C through B. Traffic arriving over a peering connection cannot leave through another peering connection, an internet gateway, a NAT gateway, a VPN or Direct Connect attached to the peer. This rule keeps peering simple and secure, but it means every pair of VPCs that need to talk needs its own connection. Teams that try to use one VPC as a hub through peering discover that it does not work, and that shared NAT or shared VPN through a peered VPC is not possible.
Edge to edge routing restrictions also surprise teams. An instance in a peered VPC cannot use the other VPC's gateway endpoint for S3 or DynamoDB, cannot reach the internet through the other VPC's NAT gateway, and cannot use its interface endpoints unless DNS and security groups are set up deliberately for cross VPC access. Interface endpoints are a partial exception: their private addresses are reachable over peering like any other address, which is how some teams centralise endpoints. Gateway endpoints are not, because they work through route table entries local to the VPC that owns them, not through addresses.
The mesh problem
Because peering is not transitive, connecting every VPC to every other requires a full mesh, and the number of connections grows with the square of the number of VPCs: n times n minus one, divided by two. Five VPCs need ten connections, twenty need 190, and fifty need over a thousand, beyond the per VPC peering limit of 125 by default. Each connection also needs routes in every relevant route table on both sides, and every new VPC means touching all the others. Peering works well for a handful of VPCs with stable relationships, and becomes unmanageable as an organisation grows.
The quadratic growth is not only a count of connections. Each peering adds routes, and route tables have a default limit of 50 routes, raisable to a few hundred at some cost to performance, so a VPC peered with dozens of others can exhaust its table. Each peering also needs security group rules on both sides, DNS settings and monitoring. Teams that started with five VPCs and peering often reach twenty before noticing that every new environment takes days of coordinated route changes across accounts, and that nobody can say with confidence which VPCs can currently reach which.
Overlapping ranges
Peering requires that the two VPCs have no overlapping CIDR blocks, since routes could not distinguish local addresses from remote ones. This is another reason the address plan from the VPC lesson matters: two VPCs that both use 10.0.0.0/16 cannot be peered at all. When overlaps already exist, the options are renumbering one VPC, connecting only specific services through PrivateLink, which does not care about overlaps, or placing private NAT gateways in front of one network so the other sees translated addresses, which adds complexity and cost.
Overlaps are especially common after acquisitions and in organisations where each team created VPCs with the console default. An inventory of every VPC's ranges, from AWS Config or IPAM, shows how bad the problem is before any connectivity project starts. Where a small number of VPCs overlap with everything, renumbering them early, by building a new VPC with a planned range and migrating workloads, is usually cheaper than years of translation layers. Where overlaps are widespread and renumbering is impossible, a service oriented design built on PrivateLink or VPC Lattice avoids network level connectivity altogether.
When peering fits
Peering is ideal for a small number of VPCs with heavy traffic between them, such as an application VPC and a shared data VPC holding databases, or two VPCs in different regions replicating data. It has no hourly charge, no processing fee, no bandwidth limit beyond the instances involved, and the lowest possible latency. For organisations with dozens of VPCs, a hub such as Transit Gateway or a shared VPC usually replaces most peering, while a few high volume pairs keep direct peerings for cost reasons.
Peering also has useful properties for cross region replication. Inter region peering carries traffic over the AWS backbone, encrypted, without the internet and without an appliance, and the only cost is inter region data transfer. Database replicas, object replication jobs and cache synchronisation between two regions often use a single peering between the primary and standby VPCs. Because the relationship is fixed and the traffic heavy, the mesh problem does not arise, and peering stays the simplest option even in organisations that run a transit gateway for everything else.
A useful rule of thumb is to ask whether the relationship would still exist if the organisation doubled in size. Two VPCs that exist because one holds a shared database the other reads heavily will still be paired in five years, and peering suits them. Relationships that exist because a new service needed to call a few others are likely to multiply, and those belong on a hub from the start. Making that judgement early avoids the later migration from a tangle of peerings to a transit gateway, which needs careful route cutover and rarely gets scheduled until something breaks.
Use peering for a few VPC pairs that exchange heavy traffic, since it is free within a zone and has no bottleneck. Expect no transitive routing, plan for non overlapping ranges, and switch to a hub before the mesh grows past what route tables and people can track.