HardExperience level: 8-15 years1 min read

How do you connect VPCs and on-prem networks — peering, Transit Gateway, PrivateLink?

Reviewed by Gurusankar M.

Asked inAmazonMicrosoftDeloitte
#vpc peering#transit gateway#privatelink#direct connect#hybrid
Report issue

Short Answer

VPC Peering: 1:1 VPC connection (non-transitive — doesn't scale to many VPCs). Transit Gateway: a hub that routes between many VPCs + on-prem (the scalable choice). PrivateLink: expose/consume a specific service privately without exposing whole networks. Direct Connect/VPN link on-prem to AWS.

On this page

Concept Made Simple

Coffee Chat Question

“How do you connect VPCs and on-prem networks — peering, Transit Gateway, PrivateLink?”

Remember It Faster

Mind Map Answer

Peering
1:1, non-transitive, few VPCs
Transit Gateway
hub-and-spoke, many VPCs + on-prem
PrivateLink
private access to ONE service
Direct Connect/VPN
on-prem ↔ AWS

Think Beyond the Expected

What If?

You have 20 VPCs that all need to talk to each other — peering or Transit Gateway?

Transit Gateway. VPC peering is non-transitive, so 20 VPCs would need ~190 individual peering connections (n·(n-1)/2) — unmanageable. Transit Gateway acts as a central hub: each VPC attaches once and routes to the others, scaling cleanly.

Real World

Peering suits a couple of VPCs; at scale, Transit Gateway is the hub for many-VPC + hybrid connectivity, and PrivateLink exposes SaaS/internal services privately without broad network access.

Interviewer's Expectation

Keywords they're listening for:

  • peering 1:1 non-transitive
  • Transit Gateway hub for scale
  • PrivateLink per-service
  • Direct Connect/VPN hybrid
  • mesh explosion problem

Common Mistakes

  • Full-mesh peering for many VPCs
  • Exposing whole VPCs when PrivateLink (one service) fits
  • Assuming peering is transitive

Best Practices

  • Transit Gateway for many-VPC/hybrid
  • PrivateLink for private per-service access
  • Peering only for a small number of VPCs

Follow-up Questions

  1. Why is VPC peering non-transitive a problem at scale?
  2. PrivateLink vs peering for exposing a service?
  3. Direct Connect vs VPN trade-offs?

Continue Learning with AI

Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.

Plain-language foundations

I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner.

Topic: VPC (AWS)
Interview question: "How do you connect VPCs and on-prem networks — peering, Transit Gateway, PrivateLink?"

Please:
1. Explain the core idea in simple, plain language, using an everyday analogy.
2. Define any technical terms you use.
3. Walk through one small, concrete example.
4. Finish with a single sentence I can easily remember.

Keep the tone friendly and assume I'm new to this topic.
Open inChatGPTGeminiClaude

Was this answer helpful?

Affiliate links

Equipment for a comfortable, productive setup.

As an Amazon Associate I earn from qualifying purchases.