How to Build a Custom VPC on AWS: A Step-by-Step Guide
Understanding the Importance of a Custom VPC on AWS
A Custom VPC (Virtual Private Cloud) is like building your own private neighborhood in the cloud instead of living in a shared apartment. Here's why it's useful:
1οΈβ£ Better Security π
With a Custom VPC, you can control who enters and exits your networkβjust like having security gates in your neighborhood. You can block unwanted visitors and allow only trusted ones.
2οΈβ£ More Control Over Network Setup βοΈ
Imagine setting up roads and houses exactly the way you want in a new neighborhood. A Custom VPC lets you decide:
How many streets (subnets) you want.
Which buildings (servers) go where.
Whether certain areas should be private or public.
3οΈβ£ Better Performance π
A Custom VPC reduces unnecessary traffic and interference, like having your own highway instead of sharing a crowded public road.
4οΈβ£ Private Connectivity π΅οΈ
You can connect your on-premise office or other services securely without exposing your data to the public internet.
5οΈβ£ Customization for Specific Needs π―
Different businesses need different network setups. A Custom VPC allows businesses to fine-tune the environment based on their needs (e.g., a food delivery app might need high-speed access to databases, while a tourism agency might need a secure backend for customer bookings).
π Bottom Line:
A Custom VPC gives you a safer, faster, and more flexible network setup compared to using AWS's default network settings. Itβs essential for businesses that care about security, performance, and control over their cloud environment. π
π― π― π― LETS DO HANDS ONπ― π― π―
Login to AWS Console:
VPC β> VPC Only β> Provide a Name β> IPv4 CIDR block (Keep Default) β> For IPv4 CIDR
You can choose any private IPv4 range from RFC 1918, which includes:
10.0.0.0/8 β (10.0.0.0 to 10.255.255.255)
172.16.0.0/12 β (172.16.0.0 to 172.31.255.255)
172.31.0.0/16 taken by AWS for Default VPC
192.168.0.0/16 β (192.168.0.0 to 192.168.255.255)
For this example going with 10.0.0.0/16
β> IPv6 CIDR block (Keep Default) β> Tenancy (Keep Default) β> Tags (Optional but in real projects we should always use Tags for better understanding)
Need to Create Internet Gateway
Internet Gateway β Create Internet Gateway β Provide a Name β Attach Internet Gateway to the VPC you created
Need to Create Route Table
Route Table β Create Route Table β Provide a Name β Select your VPC β Tags (Optional) β Now need to create a route for internet gateway β Routes β Edit Routes 0.0.0.0/0 Internet Gateway and select Internet Gateway you created
Subnet Creation
Subnet β Select VPC β Subnet Name β Availability Zone select which you needβ Need to provide Subnet CIDR Block 10.0.1.0/24 10.0.2.0/24 10.0.3.0/24
β Provide Tag and Create Subnet
NOTE:
Need to Create a different Route Table for Private Subnet and Need to exclude it from Subnets without explicit associations as it is a private subnet Also you need to enable public IP for public subnet