Subnets — Complete Guide
Subnets — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of AWS Cloud Tutorial on Toolliyo Academy.
On this page
AWS Cloud Tutorial · Lesson 12 of 100
Subnets
Core services → Projects
Core services · 1 — AWS basics · ~6 min · AWS — Networking & Security
What is this?
Subnets divide a VPC CIDR into smaller networks tied to one AZ. Public subnets route to an IGW; private subnets use NAT for outbound-only internet.
Why should you care?
AwsVerse puts ALB in public subnets and RDS in private subnets across two AZs.
See it live — copy this example
Run in AWS CloudShell / local AWS CLI v2, or follow the matching steps in the AWS Console (Free Tier).
aws ec2 create-subnet \
--vpc-id vpc-0abc123 \
--availability-zone ap-south-1a \
--cidr-block 10.20.1.0/24 \
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Tier,Value=public}]'
What happened?
- Creates a /24 public-tier subnet in one AZ.
- Repeat in another AZ for HA; associate with the correct route table.
Practice next
- Create public subnet 10.0.1.0/24 and private 10.0.10.0/24 in two AZs.
- Associate public subnet with route table pointing 0.0.0.0/0 to IGW.
- Launch test EC2 in private subnet — no direct inbound from internet.
- Add a /26 database subnet per AZ.
- Enable auto-assign public IP only on public subnets.
Remember
Subnet = AZ-scoped IP range. Public vs private is about routing. Multi-AZ subnets for HA.
AwsVerse tiered subnets
Compliance requires DB with no internet route.
Outcome: Private subnets with NAT egress only for patches.
Interview prep for this lesson
Practice these questions aloud after reading—each links to a full structured answer.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!