Amazon VPC

Virtual Private Cloud - Your isolated network in AWS

šŸ’µ Cost: VPC itself is FREE. However, NAT Gateway costs ~$32/month per AZ (fixed) + data processing fees. Internet Gateway is free. Use public subnets for cost savings in dev/test environments. Prices shown are for US East - verify at aws.amazon.com/vpc/pricing.

See our Costs & Cleanup Guide for detailed breakdown.

What is a VPC?

A Virtual Private Cloud (VPC) is your own isolated section of the AWS cloud. Think of it as your private data center in the cloud where you control the network configuration, IP addresses, and security rules.

Real-World Analogy

A VPC is like renting a floor in a secure office building. You get your own space (network), can divide it into rooms (subnets), control who enters (security groups), and connect it to the outside world (internet gateway).

Why Do You Need a VPC?

  • Isolation: Your resources are separated from other AWS customers
  • Security: Control inbound and outbound traffic with security groups and NACLs
  • Customization: Define your own IP address ranges, subnets, and routing
  • Connectivity: Connect to on-premises networks via VPN or Direct Connect

VPC Components

ComponentPurposeExample
SubnetsDivide your VPC into smaller networksPublic subnet for web servers, private for databases
Internet GatewayAllows internet access for public subnetsUsers accessing your website
NAT GatewayAllows private subnets to access internet (outbound only)Private servers downloading updates
Route TablesDefine where network traffic goesSend 0.0.0.0/0 to internet gateway
Security GroupsFirewall rules for individual resourcesAllow port 443 from anywhere
NACLsFirewall rules at subnet levelBlock specific IP ranges
Plain Text
VPC (10.0.0.0/16)
ā”œā”€ā”€ Public Subnet (10.0.1.0/24)
│   ā”œā”€ā”€ Has route to Internet Gateway
│   ā”œā”€ā”€ Resources get public IP addresses
│   └── Used for: Load balancers, bastion hosts
│
└── Private Subnet (10.0.2.0/24)
    ā”œā”€ā”€ No direct internet access
    ā”œā”€ā”€ Uses NAT Gateway for outbound traffic
    └── Used for: App servers, databases, ECS tasks

Default VPC

AWS creates a default VPC in each region with public subnets. While convenient for learning, production workloads should use custom VPCs with proper public/private subnet separation.

AWS Deployment Guide — Built with Next.js