🌐 AWS 127: Building from Scratch - Creating a Custom Public VPC

Published: (January 6, 2026 at 11:08 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

AWS

Hey Cloud Architects 👋

Welcome to Day 27 of the #100DaysOfCloud Challenge!

Today we’re stepping away from the default AWS settings and building our own custom VPC. The Networking Team needs a dedicated space for public‑facing services, complete with automated IP assignment and secure SSH access.

VPC diagram

This task is part of my hands‑on practice on the KodeKloud Engineer platform, which I highly recommend for anyone looking to master real‑world DevOps scenarios.

🎯 Objective

  • Create a custom VPC named devops-pub-vpc.
  • Create a public subnet named devops-pub-subnet.
  • Enable Auto‑assign public IPv4 address for the subnet.
  • Launch a t2.micro instance named devops-pub-ec2 inside this network.
  • Ensure port 22 (SSH) is open to the internet.

💡 Why a Custom VPC Is Essential

While AWS provides a default VPC, professional DevOps teams build custom networks to ensure:

  • Better security
  • Isolation
  • Control over IP addressing

🔹 Key Concepts

  • VPC (Virtual Private Cloud) – A logically isolated section of the AWS Cloud where you can launch resources in a virtual network that you define.
  • Internet Gateway (IGW) – The “bridge” that connects your VPC to the Internet. Without an IGW, a “public” subnet remains private.
  • Route Tables – Act as the “GPS” for your network, directing traffic to the Internet Gateway (or other targets) so it can leave the VPC.

🛠️ Step‑by‑Step: Custom Networking Workflow

We’ll move from Network Creation → Routing → Instance Provisioning.

🔹 Phase A – Create the VPC & Subnet

Create VPC

  1. Open the VPC Dashboard → Create VPC.
  2. Name the VPC devops-pub-vpc.

Create VPC screen

Create Subnet

  • Create a subnet inside the VPC and name it devops-pub-subnet.

Enable Public IPs

  • In Subnet Settings, tick “Enable auto‑assign public IPv4 address.”
    This ensures every instance launched in the subnet receives a public IP automatically.

Enable auto‑assign public IP

🔹 Phase B – Configure Internet Access (The “Public” Part)

Internet Gateway

  • Create an Internet Gateway (IGW) and attach it to devops-pub-vpc.

Create IGW screen

Update Route Table

  1. Locate the route table associated with devops-pub-subnet.
  2. Add a route:
DestinationTarget
0.0.0.0/0Your Internet Gateway

Add route screen

🔹 Phase C – Launch the Public Instance

Provision EC2

  • Launch a t2.micro instance named devops-pub-ec2.

Network Settings

  • Choose devops-pub-vpc and devops-pub-subnet in the launch wizard.

Security Group

  • Create a new security group that allows Inbound SSH (Port 22) from Anywhere (0.0.0.0/0).

EC2 launch screen

✅ Verify Success

Check Connectivity
When the instance is Running, copy its public IP address.

Terminal Test

ssh -i your-key.pem ubuntu@<public‑ip>

SSH test screen

If you can connect via SSH, your custom VPC, subnet, route table, and security group are all correctly configured. Happy cloud building! 🚀

🎉 Confirm

If you successfully log in, your custom network is officially open for business!

📝 Key Takeaways

  • 🚀 Default vs. Custom: Custom VPCs let you define your own CIDR blocks (IP ranges).
  • 🔗 Implicit Dependency: A subnet is only public if it has a route to an Internet Gateway.
  • 🛡️ Security Groups: Even in a public VPC, your instances are protected by security groups. Always apply the principle of least privilege.

🚫 Common Mistakes

  • Forgetting the IGW: Attaching an Internet Gateway is a two‑step process—create it and then attach it to the VPC.
  • Missing Route Table Entry: If you can’t SSH in, verify that the route table points to the IGW.
  • Auto‑Assign Public IP Disabled: If the instance lacks a public IP in the console, you forgot to enable the auto‑assign setting on the subnet.

🌟 Final Thoughts

You’ve just built the backbone of cloud computing! Understanding VPCs, subnets, and routing separates a “Cloud User” from a “Cloud Architect.” This setup is the foundation for hosting websites, APIs, and much more.

🌟 Practice Like a Pro

If you want to try these tasks yourself in a real AWS environment, check out:

👉 KodeKloud Engineer – Practice Labs – where I sharpen my skills daily!

🔗 Let’s Connect

Back to Blog

Related posts

Read more »

AWS VPC

What is AWS VPC? An AWS Virtual Private Cloud VPC is a logically isolated network inside AWS where you can launch resources such as: - EC2 instances - Database...

I finally Deployed on AWS

First Attempt and Billing Issues My first experience with AWS was in 2023 when the free tier offered 12 months of usage. I set up a free server to host a hobby...