DEV Community

Cover image for πŸ“… Day 13 | AWS VPC β€” The Heart of AWS Networking 🌐
Sudarshan Yadav
Sudarshan Yadav

Posted on

πŸ“… Day 13 | AWS VPC β€” The Heart of AWS Networking 🌐

πŸ“… Day 13 | AWS VPC β€” The Heart of AWS Networking 🌐

AWS VPC (Virtual Private Cloud) is the foundation of all networking inside AWS.

Every EC2 instance, database, load balancer, or container service you deploy lives inside a VPC.

Understanding VPC = understanding how your entire cloud infrastructure communicates.


πŸ”₯ Why VPC Is Essential

  • πŸ›‘οΈ Designing secure architectures
  • 🌐 Creating public & private networks
  • πŸš€ Enabling internet access with Internet Gateway (IGW) & NAT Gateway
  • πŸ”— Connecting environments using VPC Peering
  • βš™οΈ Building scalable DevOps deployments

🎯 Why You Must Master VPC

Mastering VPC gives you full control over:

  • Networking
  • Security boundaries
  • Traffic flow
  • Service-to-service connectivity

VPC is one of the most criti

AWS VPC, Subnets, IGW, NAT, Peering, SSH...


βœ… Quick Summary (What You’ll Get)

  • Create VPCs (Mumbai & Delhi) + Subnets
  • Attach Internet Gateway (IGW) + Public Route Table
  • Create NAT Gateway + Private Route Table
  • Create VPC Peering + routing both sides
  • Delete resources in correct order
  • PuTTYgen steps to convert PEM ↔ PPK

1) Create a VPC (Example)

Step Action
Console VPC β†’ Create VPC β†’ VPC only
Name MyVPC01
IPv4 CIDR 10.0.0.0/24 (or /16 for more IPs)
Result VPC created

2) Create Subnets

Public Subnet (example)

Field Value
VPC MyVPC01
Name sub-public-1
AZ ap-south-1a
CIDR 10.0.0.0/28
Auto-assign public IPv4 Enable

Private Subnet (example)

Field Value
VPC MyVPC01
Name sub-private-1
CIDR 10.0.1.0/28
Auto-assign public IPv4 Disable

3) Internet Gateway (IGW) + Public Route Table

Internet Gateway

Step Action
Create VPC β†’ Internet Gateways β†’ Create
Name igw-mumbai
Attach Attach to MyVPC01

Public Route Table

Step Action
Create/Select Route tables β†’ public-rt
Add Route 0.0.0.0/0 β†’ Internet Gateway (igw-mumbai)
Associate Public Subnet (sub-public-1)

4) NAT Gateway (Private β†’ Outbound Internet)

Step Action
Create NAT Gateway in public subnet (sub-public-1)
EIP Allocate new Elastic IP
Result NAT Gateway created

Private Route Table

Route Target
0.0.0.0/0 NAT Gateway

Associate this route table with the private subnet (sub-private-1).

Outcome:

Private EC2 β†’ outbound internet OK, inbound blocked.


5) Security Groups (Recommended)

Public EC2 SG

Rule Value
Inbound SSH (22) from your IP
Inbound HTTP/HTTPS (80/443) from 0.0.0.0/0 (if web)
Outbound All allowed

Private EC2 SG

Rule Value
Inbound From Public EC2 SG or ALB
Outbound All allowed

6) EC2 Deployment

Public EC2

  • Launch into sub-public-1
  • Use Public-SG
  • This can serve as a bastion/jump host

Private EC2

  • Launch into sub-private-1
  • Use Private-SG
  • SSH through bastion only

7) Create VPCs for Peering (Mumbai & Delhi)


Mumbai VPC

Item Value
VPC Name vpc-mumbai
CIDR 10.0.0.0/16
Subnet sub1-mumbai β†’ 10.0.0.0/28
IGW igw-mumbai
Public RT Route β†’ 0.0.0.0/0 β†’ igw-mumbai

Delhi VPC

Item Value
VPC Name vpc-delhi
CIDR 172.16.0.0/16
Subnet sub1-delhi β†’ 172.16.0.0/28
IGW igw-delhi
Public RT Route β†’ 0.0.0.0/0 β†’ igw-delhi

8) VPC Peering (Mumbai ↔ Delhi)

Create Peering

Step Action
Create VPC β†’ Peering Connections
Name my-peering
Requester vpc-mumbai
Accepter vpc-delhi

Accept request from the Delhi side.

Add Routes (Both Sides)

Mumbai Route Table

Destination Target
172.16.0.0/16 Peering Connection

Delhi Route Table

Destination Target
10.0.0.0/16 Peering Connection

Security Groups

Allow from peer CIDRs if required.


9) Deletion / Cleanup Order

Order Delete
1 Peering connection
2 EC2 Instances
3 NAT Gateway (release EIP)
4 Detach/Delete IGW
5 Subnets
6 Route Tables
7 VPC

This avoids β€œresource in use” errors.


10) AWS Limits & Quotas

Resource Default Limit
VPCs per Region Usually 5
Subnets Large (no issue normally)
NAT Gateways Limited by region, costly

Request quota increase via AWS Service Quotas.


Thank You

πŸ”— Connect With Me

🌐 Platform πŸ”— Link
πŸ™ GitHub https://lnkd.in/d2F3JPa3
✍️ Dev.to Blog https://lnkd.in/dNtgqAME
πŸ’Ό LinkedIn https://lnkd.in/d3NctxFT
πŸ“„ Resume (Google Drive) https://lnkd.in/dHDNsd_D

πŸ”– Hashtags

AWS #DevOps #CloudComputing #AWSLearning #EBS #VolumeMounting #DataPersistence #LearningJourney #CareerGrowth #DevOpsEngineer #AWSCommunity

Top comments (0)