DEV Community

Cover image for How to Create a VPC in AWS
daniel shaibu
daniel shaibu

Posted on

How to Create a VPC in AWS

A Virtual Private Cloud (VPC) is the foundation of every AWS network. It lets you define your own IP ranges, create public/private subnets, attach gateways, and control traffic flow. VNet (Azure) serves a similar purpose in Azure — it’s the foundation of Azure networking, enabling communication between Azure resources, on-premises networks, and the internet. VNets define the overall address space and can be segmented into subnets. Security is managed using Network Security Groups (NSGs), which combine AWS SG and NACL functionality, and VNets support peering and VPN/ExpressRoute for hybrid connectivity.
Subnets exist within a VPC or VNet and divide the network into smaller, manageable segments. Each subnet has its own IP address range (CIDR block) and can be associated with specific route tables and security rules. In AWS, subnets are AZ-specific and can be public or private depending on routing to an Internet Gateway. In Azure, subnets are not tied to physical zones but are logical divisions of the VNet, often used for tiered application design and traffic isolation .

Key distinctions:

Scope: VPC/VNet define the entire virtual network, subnets are segments within them.

Function: VPC/VNet handle global network configuration (address space, connectivity), subnets handle resource grouping and traffic control.

Connectivity: VPC/VNet connect to other networks (on-premises, internet), subnets control internal segmentation.

Security: VPC (AWS) uses SG + NACL; VNet (Azure) uses NSG; subnets inherit and apply these rules at their level.

Example: For a 3-tier app —

VPC/VNet: Encompasses all tiers.

Subnets: Separate ones for web, application, and database layers for isolation and security.

AWS: VPC (10.0.0.0/16)
├── Public Subnet (10.0.1.0/24) - Web servers
├── Private Subnet (10.0.2.0/24) - App servers
└── Private Subnet (10.0.3.0/24) - Database
Azure: VNet (10.1.0.0/16)
├── Subnet-Frontend (10.1.1.0/24)
├── Subnet-App (10.1.2.0/24)
└── Subnet-DB (10.1.3.0/24)
Copy
This layered approach ensures security, scalability, and efficient traffic management in both AWS and Azure environments.

Step‑by‑Step Guide on How to Create a VPC in AWS

Step 1 — Open the Amazon VPC Console

  1. Sign in to the AWS Management Console.

  2. In the search bar, type VPC and open Amazon VPC.

  3. On the left menu, select Your VPCs.

Step 2 — Start the VPC Creation Wizard
AWS provides two options:

  • VPC and more (recommended — creates subnets, route tables, and gateways automatically)

  • VPC only (creates only the VPC)

For most tutorials and DEV articles, choose Create VPC → VPC and more.

Step 3 — Configure VPC Settings
Fill in the following fields:

VPC Settings
Name tag: my-vpc

IPv4 CIDR block: 10.0.0.0/16 (common beginner-friendly range)

Tenancy: Default

Subnets
Choose:

Number of Availability Zones: 1

Public subnets: 1

Private subnets: 1

Gateways & Routing
Make sure these are enabled:

Create an Internet Gateway

Create a NAT Gateway (for private subnet outbound access)

Step 4 — Review and Create

Step 5 - create subnet ( you create the subnet inside the VPC)
In the search bar, search for subnet

click on create subnet

configure the subnet

create subnet

Step 6 - create an internet gateway
on the search bar, search for internet gateway

click on create internet gateway

Configure the internet gateway

Step 7 - create a route table
in the search bar, search for route table

Click on the create route table

Give it a name and select the VPC and click on create route table

Top comments (0)