By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
A Hyper-Practical, Zero-Fluff Study Guide for AWS Solutions Architect – Associate
You’re a cloud engineer at a fintech startup. Your team just migrated a monolithic app to AWS, but now: - Security teams demand strict network isolation between payment processing and customer-facing APIs.- DevOps complains that private instances can’t reach the internet for updates (but must stay private).- Finance wants to avoid a $5K/month NAT Gateway bill because someone misconfigured subnets.
VPC Fundamentals are the foundation of AWS networking. If you mess this up: - Your database gets exposed to the internet (hello, ransomware).- Your app crashes because instances can’t talk to each other.- Your AWS bill skyrockets due to misrouted traffic.
This guide gives you the superpower to:✅ Design secure, scalable networks from scratch.✅ Debug "why can’t my instance reach the internet?" in 5 minutes.✅ Pass the AWS SAA exam by mastering the 20% of VPC concepts that appear in 80% of questions.
10.0.0.0/16
/24
/28
aws configure
aws ec2
aws ec2 create-vpc --cidr-block 10.0.0.0/16 --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=MyVPC}]'
Output:
{ "Vpc": { "VpcId": "vpc-1234567890abcdef0", "CidrBlock": "10.0.0.0/16" } }
Verify:
aws ec2 describe-vpcs --vpc-ids vpc-1234567890abcdef0
aws ec2 create-subnet \ --vpc-id vpc-1234567890abcdef0 \ --cidr-block 10.0.1.0/24 \ --availability-zone us-east-1a \ --tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=PublicSubnet}]'
aws ec2 create-subnet \ --vpc-id vpc-1234567890abcdef0 \ --cidr-block 10.0.2.0/24 \ --availability-zone us-east-1a \ --tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=PrivateSubnet}]'
aws ec2 describe-subnets --filters "Name=vpc-id,Values=vpc-1234567890abcdef0"
aws ec2 create-internet-gateway --tag-specifications 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=MyIGW}]'
{ "InternetGateway": { "InternetGatewayId": "igw-1234567890abcdef0" } }
Attach IGW to VPC:
aws ec2 attach-internet-gateway --vpc-id vpc-1234567890abcdef0 --internet-gateway-id igw-1234567890abcdef0
aws ec2 create-route-table --vpc-id vpc-1234567890abcdef0 --tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=PublicRT}]'
Add route to IGW:
aws ec2 create-route \ --route-table-id rtb-1234567890abcdef0 \ --destination-cidr-block 0.0.0.0/0 \ --gateway-id igw-1234567890abcdef0
Associate with Public Subnet:
aws ec2 associate-route-table --subnet-id subnet-1234567890abcdef0 --route-table-id rtb-1234567890abcdef0
aws ec2 create-route-table --vpc-id vpc-1234567890abcdef0 --tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=PrivateRT}]'
Associate with Private Subnet:
aws ec2 associate-route-table --subnet-id subnet-abcdef1234567890 --route-table-id rtb-abcdef1234567890
aws ec2 allocate-address --domain vpc --tag-specifications 'ResourceType=elastic-ip,Tags=[{Key=Name,Value=MyNAT-EIP}]'
{ "AllocationId": "eipalloc-1234567890abcdef0", "PublicIp": "203.0.113.42" }
aws ec2 create-nat-gateway \ --subnet-id subnet-1234567890abcdef0 \ --allocation-id eipalloc-1234567890abcdef0 \ --tag-specifications 'ResourceType=natgateway,Tags=[{Key=Name,Value=MyNAT}]'
{ "NatGateway": { "NatGatewayId": "nat-1234567890abcdef0" } }
Add route to Private Route Table:
aws ec2 create-route \ --route-table-id rtb-abcdef1234567890 \ --destination-cidr-block 0.0.0.0/0 \ --nat-gateway-id nat-1234567890abcdef0
aws ec2 run-instances \ --image-id ami-0c55b159cbfafe1f0 \ # Amazon Linux 2 --instance-type t2.micro \ --subnet-id subnet-abcdef1234567890 \ --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=PrivateTest}]'
SSH into a bastion host in the public subnet, then:
ssh -i "key.pem" ec2-user@<private-instance-ip>
Test internet access:
ping 8.8.8.8 # Should work (NAT Gateway) curl ifconfig.me # Should return your NAT Gateway's public IP
443
22
0.0.0.0/0
us-east-1a
us-east-1b
Environment=Prod
Owner=TeamX
vpc-prod-app
subnet-public-1a
rt-private-db
BytesOutToDestination
10.1.0.0/16
❌ Internet Gateway (only for public subnets).
"How do you block a specific IP from accessing a subnet?"
❌ Security Group (stateful, instance-level).
"You need a highly available NAT solution. What do you use?"
"You need to allow a Lambda function in a private subnet to access an RDS database in the same VPC. What’s the most secure way?"- ✅ VPC Endpoint for RDS (private connectivity, no NAT needed).- ❌ NAT Gateway (unnecessary cost/complexity).
Challenge:You deployed a VPC with a public subnet and an EC2 instance. The instance can’t reach the internet. Debug and fix it.
Solution:1. Check the route table for the subnet: bash aws ec2 describe-route-tables --filters "Name=association.subnet-id,Values=subnet-1234567890abcdef0" 2. If 0.0.0.0/0 is missing, add it: bash aws ec2 create-route --route-table-id rtb-1234567890abcdef0 --destination-cidr-block 0.0.0.0/0 --gateway-id igw-1234567890abcdef0 3. Verify the instance’s security group allows outbound traffic (default: yes).
bash aws ec2 describe-route-tables --filters "Name=association.subnet-id,Values=subnet-1234567890abcdef0"
bash aws ec2 create-route --route-table-id rtb-1234567890abcdef0 --destination-cidr-block 0.0.0.0/0 --gateway-id igw-1234567890abcdef0
Why it works: The route table must explicitly direct internet-bound traffic (0.0.0.0/0) to the IGW.
aws ec2 create-vpc --cidr-block
/16
172.31.0.0/16
t3.nano
Final Tip: Draw your VPC on paper before deploying. Label subnets, route tables, and gateways. It’ll save you hours of debugging. ?
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.