🚀 Beginner’s Guide: How to Create a VPC and Subnets on AWS (Step-by-Step)
If you’re just getting started with AWS networking, creating your first VPC and subnets might sound complicated — but trust me, it’s easier than it looks.
In this guide, you’ll learn step by step how to set up your Virtual Private Cloud (VPC) and subnets on AWS.
🧠 What’s a VPC?
A VPC (Virtual Private Cloud) is your own private network inside AWS.
Think of it as a virtual data center — you decide the IP ranges, subnets, and how resources talk to each other securely.
Let’s dive in! 👇
🧭 Step 1: Log in to AWS Console
Go to AWS Console and sign in. Once logged in, search for VPC in the search bar and open the VPC Dashboard.
🏗️ Step 2: Create a New VPC
- In the VPC Dashboard, click “Create VPC.”
- Under Resources to create, select VPC only.
- Fill in the details:
- 
Name tag: MyFirstVPC
- 
IPv4 CIDR block: 10.0.0.0/16
- Tenancy: Default
 
- 
Name tag: 
- Click Create VPC.

✅ Boom! You’ve created your first VPC.
🌍 Step 3: Create Subnets
Subnets divide your VPC into smaller sections — typically one per Availability Zone (AZ) for high availability.
Let’s create three subnets.
- On the left panel, click Subnets → Create subnet.
- Under VPC ID, select your MyFirstVPC.
- Add the following subnets:
| Subnet Name | Availability Zone | IPv4 CIDR Block | 
|---|---|---|
| Public-Subnet-A | us-east-1a | 10.0.0.0/24 | 
| Public-Subnet-B | us-east-1b | 10.0.1.0/24 | 
| Private-Subnet-A | us-east-1a | 10.0.2.0/24 | 
🌐 Step 4: Enable Auto-Assign Public IP for Public Subnets
This ensures instances in your public subnets can connect to the internet.
- Select Public-Subnet-A.
- Click Actions → Edit subnet settings.
- Enable Auto-assign IP settings → check Auto-assign IPv4.
- Save changes.
- Repeat for Public-Subnet-B.
🛣️ Step 5: Create and Attach an Internet Gateway
An Internet Gateway (IGW) allows your VPC to communicate with the internet.
- In the VPC Dashboard, go to Internet Gateways.
- Click Create Internet Gateway.
- 
Name: MyVPC-IGW
 
- 
Name: 
- Click Create Internet Gateway, then Attach to VPC → select your MyFirstVPC.
🗺️ Step 6: Update Route Tables
We’ll connect our public subnets to the internet through the Internet Gateway.
- Go to Route Tables in the VPC Dashboard.
- Select the route table linked to MyFirstVPC.
- Under Routes, click Edit routes → Add route:
- 
Destination: 0.0.0.0/0
- 
Target: Internet Gateway (MyVPC-IGW)
 
- 
Destination: 
- Click Save changes.
- Under Subnet Associations, associate your Public Subnets (A & B) with this route table.
✅ Step 7: Verify Everything
Head back to your VPC → Subnets, and confirm:
- You have 3 subnets (2 public, 1 private).
- Public subnets have auto-assign IPs enabled.
- Your route table connects to the Internet Gateway.
🎉 Congratulations — you’ve successfully created a VPC with subnets on AWS!
 















 
 
    
Top comments (0)