# VPC Peering, Transit Gateway and Hybrid Connectivity

> Connect VPCs to each other and to on-premises networks using peering, Transit Gateway, Site-to-Site VPN and Direct Connect. Free notes, key concepts, resources...

Canonical: https://www.internhack.in/roadmaps/tracks/cloud-engineer/vpc-connectivity
Last updated: 2026-11-28

Connect VPCs to each other and to on-premises networks using peering, Transit Gateway, Site-to-Site VPN and Direct Connect.

Advanced · about 4 hours · difficulty 4/5

Learn first: [NAT Gateways, Security Groups and NACLs](https://www.internhack.in/roadmaps/tracks/cloud-engineer/nat-security-groups)

As soon as a company has more than one VPC or an office network, you need to connect them. Each option trades simplicity, scale and cost.

### VPC peering

- A private, one-to-one connection between two VPCs (same or different accounts and regions).
- **Not transitive**: if A peers with B and B with C, A cannot reach C through B.
- No overlapping CIDRs allowed. Cheap and simple for a handful of VPCs.

### Transit Gateway

- A regional **hub** that many VPCs and VPNs attach to, like a cloud router.
- Supports route tables for segmentation (prod cannot talk to dev).
- Scales to thousands of attachments, but charges per attachment hour and per GB.
- Azure's equivalent is a hub VNet or Virtual WAN; GCP uses Network Connectivity Center.

### Hybrid connectivity

- **Site-to-Site VPN**: encrypted IPsec tunnels over the internet to an office or data centre. Quick to set up.
- **Direct Connect**: a dedicated private link from a data centre or partner location (there are locations in Mumbai, Chennai, Delhi and other cities). Predictable latency, higher cost and lead time.
- **Client VPN** for individual users.

### Choosing

- Two or three VPCs: peering.
- Many VPCs or accounts, plus on-premises: Transit Gateway.
- Exposing one service to many consumers without full network access: PrivateLink (next topic).

### Pitfalls

- Overlapping CIDRs that make peering impossible later.
- Building a mesh of dozens of peering connections instead of a hub.

You are ready to move on when you can choose between peering, Transit Gateway and PrivateLink for a given scenario and explain why.

## Key concepts

- **VPC peering**
- **Non-transitive routing**
- **Transit Gateway**
- **Transit Gateway route tables**
- **Site-to-Site VPN**
- **Direct Connect**
- **Client VPN**

## Mini project

Create two small VPCs with non-overlapping CIDRs, peer them, update route tables and security groups, and ping between two free-tier instances. Write how the design would change with ten VPCs. Skip Transit Gateway in the lab because it bills hourly; terminate instances and delete the peering when done.

## Check yourself

VPC A peers with B, and B peers with C. Can an instance in A reach C? What would you use instead?

## Free resources

- [VPC peering](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) (AWS)
- [AWS Transit Gateway](https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html) (AWS)
- [AWS Direct Connect](https://docs.aws.amazon.com/directconnect/) (AWS)

Previous: [NAT Gateways, Security Groups and NACLs](https://www.internhack.in/roadmaps/tracks/cloud-engineer/nat-security-groups) · Next: [VPC Endpoints and PrivateLink](https://www.internhack.in/roadmaps/tracks/cloud-engineer/vpc-endpoints)

## More in VPC Networking

- [VPC, Subnets, Route Tables and Internet Gateways](https://www.internhack.in/roadmaps/tracks/cloud-engineer/vpc-basics)
- [NAT Gateways, Security Groups and NACLs](https://www.internhack.in/roadmaps/tracks/cloud-engineer/nat-security-groups)
- [VPC Peering, Transit Gateway and Hybrid Connectivity](https://www.internhack.in/roadmaps/tracks/cloud-engineer/vpc-connectivity)
- [VPC Endpoints and PrivateLink](https://www.internhack.in/roadmaps/tracks/cloud-engineer/vpc-endpoints)
- [Route 53 and CloudFront at the Edge](https://www.internhack.in/roadmaps/tracks/cloud-engineer/route53-cloudfront)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cloud Engineer (AWS) Roadmap](https://www.internhack.in/roadmaps/tracks/cloud-engineer)
