SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free🗺️ Learning Roadmaps

VPCOverview

What it is, why it matters, architecture and key concepts

✍️
Written by senior engineers. Reviewed for technical accuracy.· Updated 2025 · SynfraCore VPC Team
Expert Content

AWS VPC — Your Private Network in the Cloud

A VPC (Virtual Private Cloud) is your own isolated network inside AWS. When you launch EC2 instances, RDS databases, or Lambda functions — they all live inside a VPC. You control the IP ranges, subnets, routing, and firewalls.

VPC Architecture

🌐 Internet Internet Gateway (IGW) VPC: 10.0.0.0/16 Public Subnet (10.0.1.0/24) — AZ-1a NAT Gateway Elastic IP attached App Load Balancer Public-facing Route: 0.0.0.0/0 → IGW | 10.0.0.0/16 → local Public Subnet (10.0.2.0/24) — AZ-1b NAT Gateway Elastic IP attached App Load Balancer Multi-AZ Route: 0.0.0.0/0 → IGW | 10.0.0.0/16 → local Private Subnet (10.0.3.0/24) — App Tier EC2 / ECS App servers EC2 / ECS App servers Private Subnet (10.0.4.0/24) — DB Tier RDS Primary No internet access RDS Standby Multi-AZ failover Route: 0.0.0.0/0 → NAT GW | 10.0.0.0/16 → local Route: 10.0.0.0/16 → local only (no internet!)

Public vs Private Subnets

Public SubnetPrivate Subnet

|---|---|---|

**Internet access**Direct via IGWOutbound only via NAT
What lives hereLoad balancers, NAT GatewayApp servers, databases
Public IPAssigned automaticallyNo public IP
SecurityExposed to internetProtected
💡 Design Rule

Load Balancers → Public subnet (need internet access)

App Servers → Private subnet (only ALB needs to reach them)

Databases → Private subnet with NO internet route

Security Groups vs Network ACLs

Security Group Instance level · Stateful ✅ Inbound: Port 443 from 0.0.0.0/0 ✅ Inbound: Port 22 from 10.0.0.0/8 🔄 Response traffic auto-allowed (stateful) Allow rules only All rules evaluated together Network ACL Subnet level · Stateless Rule 100: Allow 443 inbound Rule 200: Deny specific IP inbound Must also allow ephemeral ports 1024-65535 Allow AND Deny rules Rules evaluated in order (lowest number first)

Quick Setup with AWS CLI

bash
# Create VPC
aws ec2 create-vpc --cidr-block 10.0.0.0/16 \
    --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=prod-vpc}]'

# Create public subnet
aws ec2 create-subnet --vpc-id vpc-xxx \
    --cidr-block 10.0.1.0/24 --availability-zone us-east-1a

# Create Internet Gateway and attach
aws ec2 create-internet-gateway
aws ec2 attach-internet-gateway --vpc-id vpc-xxx --internet-gateway-id igw-xxx

# Add route for public subnet
aws ec2 create-route --route-table-id rtb-xxx \
    --destination-cidr-block 0.0.0.0/0 --gateway-id igw-xxx
Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
Up Next
🔤
VPCFundamentals
Core concepts from scratch
Also Worth Exploring
← Back to all VPC modules
Prerequisites