How to Build a Custom VPC on AWS: A Step-by-Step Guide

How to Build a Custom VPC on AWS: A Step-by-Step Guide

Understanding the Importance of a Custom VPC on AWS

Β·

3 min read

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:

  1. 10.0.0.0/8 β†’ (10.0.0.0 to 10.255.255.255)

  2. 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

  3. 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

Β