Create your own VPC, subnet and Internet Gateway
Source: Dev.to
What I built
- A VPC (Virtual Private Cloud)
- A public subnet within the VPC
- An Internet Gateway (IGW) attached to the VPC
These components together create a functional and secure network inside AWS.
How the components connect
VPC creation
- Assigned a name to the VPC.
- Defined an IPv4 CIDR block (e.g.,
10.0.0.0/16).- The CIDR block defines the IP address range available inside the VPC.
- Think of the VPC as a boundary where all networking rules apply.
Public subnet creation
- Created a subnet inside the VPC and assigned it a CIDR block that falls within the VPC’s range.
- Enabled Auto‑assign Public IPv4 Address in the subnet settings.
- Selected an Availability Zone (AZ) for the subnet, improving fault tolerance and availability.
Why a public subnet?
- It is accessible from the internet.
Internet Gateway (IGW)
- Created an Internet Gateway.
- Attached the IGW to the VPC.
The IGW acts as a bridge between the VPC and the external internet. Without an IGW, even a “public” subnet cannot send or receive internet traffic.
Core networking concepts
VPC overview
- An isolated virtual network within AWS.
- Allows you to:
- Secure resources
- Control inbound and outbound traffic
- Design custom network architectures
Analogy: A VPC is like Google Drive; a subnet is a logical subdivision used to group similar resources.
Subnet types
- Public Subnet: Can communicate with the internet.
- Private Subnet: No direct internet access (ideal for databases, backend services).
A single VPC can contain multiple subnets, each belonging to one Availability Zone.
CIDR (Classless Inter-Domain Routing)
- Defines the IP address range for a network.
- Example:
10.0.0.0/810.0.0.0→ Network address/8→ Number of bits used for the network portion
Key takeaway:
- Smaller slash number = larger IP range
- Larger slash number = smaller IP range
Planning tip: You cannot change a VPC CIDR block later, so careful planning is essential to avoid scaling issues.
Key takeaways
- VPCs exist to provide isolated, secure networking environments in AWS.
- Subnets organize resources and can be public or private depending on required internet access.
- An Internet Gateway is mandatory for any internet‑facing architecture.
- Proper CIDR planning is crucial for future scalability.
Conclusion
This hands‑on project clarified AWS networking fundamentals by showing how VPCs, subnets, and Internet Gateways work together. Understanding these concepts makes it easier to design secure and scalable cloud architectures.
Part 1 of the AWS Networking series.