AWS Builder Center

What I Learned About AWS VPCs by Building One from Scratch

Built and configured an Amazon VPC to gain hands-on experience with CIDR addressing, subnet design, routing, Security Groups, Internet Gateways and Network ACLs.

What I Learned About Amazon VPCs by Building One from Scratch

When I first started learning AWS networking, terms like VPC, subnet, route table, Internet Gateway, and Network ACL seemed like separate concepts. Building a VPC myself helped me understand that these components are actually parts of one larger system that controls how resources communicate.

Starting with the VPC

A VPC is essentially an isolated virtual network in AWS where cloud resources can be deployed and organized.
For my project, I created a VPC using the CIDR block  10.0.0.0/16 . Understanding CIDR notation was important because the VPC's CIDR block defines the range of private IP addresses available within the network.
Rather than treating the CIDR block as just a value required during setup, I started thinking of it as the address space for the entire network.

Understanding Subnets

After creating the VPC, I created a subnet within it.
One of the most useful concepts I learned was that a subnet itself is not automatically public or private. Its connectivity depends largely on how its route table is configured.
A public subnet can have a route to an Internet Gateway, allowing resources in the subnet to communicate with the internet when the appropriate public addressing and security controls are also configured.
A private subnet, on the other hand, does not have a direct route to an Internet Gateway.
This distinction made much more sense after I actually configured the networking components instead of only reading about them.

Route Tables Control the Path

Route tables were another important part of the learning process.
A route table determines where network traffic should go. Within my VPC, I encountered the local route:
 10.0.0.0/16 → local 
This route allows resources within the VPC to communicate with other resources in the VPC according to the applicable networking and security controls.
For internet-bound traffic, a public subnet can use a route such as:
 0.0.0.0/0 → Internet Gateway 
The key lesson for me was that simply creating an Internet Gateway does not automatically make every subnet public. The subnet also needs the appropriate route.

Public vs. Private Networking

Working with both public and private subnets helped me understand why cloud architectures separate resources based on their connectivity requirements.
For example, a web-facing resource may need internet connectivity, while an internal application or database may not need direct internet access.
This separation can reduce exposure and provide a better foundation for implementing security controls.

Security Is More Than Routing

Another important lesson was that routing determines where traffic can go, but it does not by itself determine whether traffic is allowed.
AWS provides different layers of network security, including:
  • Security Groups
  • Network ACLs
  • Route tables
  • Internet Gateways
Understanding the difference between these components helped me see that AWS networking is not just about connecting resources. It is also about controlling and restricting communication.

Using AWS CLI

I also used AWS CLI through AWS CloudShell to work with my VPC resources.
Commands such as:
 aws ec2 create-vpc 
and
 aws ec2 create-subnet 
gave me a different perspective compared with using only the AWS Management Console.
The CLI made it easier to understand that the resources I create in the console are ultimately backed by AWS API operations.

My Biggest Takeaway

The biggest lesson from building a VPC was that cloud networking becomes much easier to understand when the components are viewed together.
A simplified mental model I now use is:
VPC → Subnets → Route Tables → Gateways → Security Controls
Each component has a specific responsibility, but they work together to determine how resources communicate.
Building the environment myself also showed me why troubleshooting networking problems requires checking multiple layers instead of assuming that one configuration controls everything.
I'm still learning AWS networking, but building this project gave me a much stronger foundation for understanding more advanced topics such as VPC peering, VPC Flow Logs, VPC endpoints, and private connectivity.

What's Next?

I'm continuing my AWS networking journey by exploring additional VPC concepts and documenting each project as I go.
My goal is not just to learn individual AWS services, but to understand how they can be combined to build secure and well-structured cloud infrastructure.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article