EC2 and VPC from Scratch
Build a two-tier VPC from scratch using the CLI — public and private subnets in two Availability Zones, an Internet Gateway, a NAT Gateway, route tables, and a security group — then launch an EC2 instance into the public subnet.
Prerequisites: An AWS account, AWS CLI v2 configured, and jq installed (used to parse CLI output). Note: NAT Gateways incur hourly charges (~$0.045/hr); delete them when done.
The default VPC that comes with every AWS account is convenient for learning but isn't shaped for real workloads. In this project you'll build the standard two-tier VPC topology from scratch — the one that appears in virtually every AWS reference architecture — with public subnets (for load balancers and internet-facing resources) and private subnets (for application servers and databases), spread across two Availability Zones for resilience.
Everything here is done with the CLI so the commands are repeatable and scriptable. By the end you'll understand the networking primitives well enough to recognize why each component exists and what breaks if it's missing.
Create the VPC and enable DNS
Create subnets, Internet Gateway, and NAT Gateway
Configure route tables
Launch an EC2 instance into the public subnet
Secret Mission: Verify private subnet isolation
Before You Go
Test what you just learned
Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.
Log in to unlock0 / 7 complete
