Thursday, July 30, 2026

AWS VPC (Virtual Private Cloud) Creation – Step-by-Step Guide

A VPC (Virtual Private Cloud) is your own private network inside AWS where you can launch resources like EC2 instances, RDS databases, Load Balancers, and more.

VPC Architecture

                     Internet
                         │
                 Internet_Gateway
                         │
                 +----------------+
                 |      VPC       |
                 | 10.0.0.0/16    |
                 +----------------+
                  │             │
          Public Subnet     Private Subnet
         10.0.1.0/24        10.0.2.0/24
             │                  │
          EC2 Server        Database Server
             │
       Public IP Address

Step 1: Login to AWS Console

  1. Login to AWS
  2. Search VPC
  3. Open VPC Dashboard


Step 2: Create VPC

Click

Create VPC

Choose

VPC only

Fill details

Field    Value
Name                    My-VPC
IPv4 CIDR10.0.0.0/16
IPv6None
TenancyDefault

Click

Create VPC

Your VPC is ready.

Step 3: Create Public Subnet

Go to

Subnets → Create subnet

Choose your VPC

Enter

Field      Value
Name   Public-Subnet
Availability Zone   ap-south-1a
IPv4 CIDR                       10.0.1.0/24

Click

Create Subnet

Step 4: Create Private Subnet

Again click

Create Subnet

FieldValue
NamePrivate-Subnet
AZap-south-1b
CIDR                   10.0.2.0/24

Click

Create

Step 5: Create Internet Gateway

Go to

Internet Gateways

Click

Create Internet Gateway

Name

My-IGW

Click

Create

Now

Select the IGW

Click

Actions → Attach to VPC

Choose

My-VPC

Done.

Step 6: Create Route Table

Go to

Route Tables

Click

Create Route Table

Name

Public-RouteTable

Select

My-VPC

Create.

Step 7: Add Internet Route

Open the Route Table

Click

Routes → Edit Routes

Add

DestinationTarget
0.0.0.0/0          Internet Gateway

Save.

This route means:

"Send all internet traffic through the Internet Gateway."

Step 8: Associate Public Subnet

Inside Route Table

Choose

Subnet Associations

Click

Edit

Select

Public-Subnet

Save.

Now only this subnet has internet access.

Step 9: Enable Auto-Assign Public IP

Go to

Subnets

Select

Public-Subnet

Choose

Edit subnet settings

Enable

✅ Auto-assign Public IPv4

Save.

Step 10: Launch EC2 Instance

Go to EC2

Launch Instance

Choose

  • Amazon Linux
  • t2.micro (Free Tier)

Under Network

Select

My-VPC

Select

Public-Subnet

Enable

Assign Public IP = Enabled

Launch.

Now your EC2 can access the internet.


Final Architecture

                  Internet
                      │
              Internet Gateway
                      │
        -----------------------------
        |          My-VPC           |
        |      10.0.0.0/16          |
        |                           |
        |    Public Subnet          |
        |    10.0.1.0/24            |
        |          │                |
        |   EC2 (Public IP)         |
        |                           |
        |---------------------------|
        | Private Subnet            |
        |10.0.2.0/24                |
        |      │                    |
        |   RDS / Private EC2       |
        -----------------------------

Components Summary

ComponentPurpose
VPCCreates your private AWS network
SubnetDivides the VPC into smaller networks
Public SubnetResources can access the internet
Private SubnetResources stay isolated from the internet
Internet Gateway        Connects the VPC to the internet
Route TableControls where network traffic goes
Security GroupInstance-level firewall
Network ACLSubnet-level firewall


Best Practices

  • Use separate public and private subnets.
  • Keep databases (RDS) in private subnets.
  • Allow only necessary ports in Security Groups (e.g., SSH: 22, HTTP: 80, HTTPS: 443).
  • Use CIDR blocks that don't overlap with other networks (e.g., 10.0.0.0/16).
  • Use at least two Availability Zones for high availability.
  • For private subnets that need outbound internet access (e.g., software updates), use a NAT Gateway in a public subnet instead of exposing them directly.


Interview Questions

  1. What is a VPC?
  2. What is the difference between a public and private subnet?
  3. What is an Internet Gateway?
  4. What is the purpose of a Route Table?
  5. Why do we use CIDR notation?
  6. What is the difference between a Security Group and a Network ACL?
  7. Can an EC2 instance in a private subnet access the internet? (Yes, via a NAT Gateway if configured.)
  8. Why should databases be placed in a private subnet?
  9. Can multiple subnets exist in one VPC? (Yes.)
  10. What happens if you don't attach an Internet Gateway to a VPC?

This workflow creates a basic, production-style VPC that you can use for hosting web applications while keeping backend services such as databases securely isolated.

please provide list of these steps

AWS VPC Creation – Step-by-Step Checklist

Step

Linux vs Windows System Administration Roadmap | Common Skills Guide

 Common Roadmap for Linux & Windows System Administrators Linux System Administration and Windows SystemAdministration have many commo...