
AWS Cloud Quest: VPC Networking & Subnet Routing
Learn how to configure a custom VPC, provision public and private subnets, attach an Internet Gateway, and manage route tables in AWS Cloud Quest.
Hands-On AWS Cloud Quest: Configuring VPCs and Custom Networking
Setting up a robust virtual network architecture is one of the foundational requirements for deploying scalable applications in AWS. In this hands-on assignment from AWS Cloud Quest, the goal is to build, isolate, and route traffic within a custom Virtual Private Cloud (VPC) from scratch.
This article breaks down the step-by-step configuration of subnets, internet gateways, and routing tables to establish secure network connectivity.
1. Architecture & Design Overview
The lab assignment requires building a two-tier network architecture across a dedicated Virtual Private Cloud (VPC):
- VPC Block: 10.0.0.0/16
- Public Subnet: 10.0.1.0/24 (Hosts public-facing resources such as load balancers or bastion hosts)
- Private Subnet: 10.0.2.0/24 (Hosts sensitive workloads, such as backend database instances)
- Internet Gateway (IGW): Attached to the VPC to enable outbound and inbound traffic for public resources.
- Route Tables: Distinct routing logic applied to separate public internet traffic from private internal communication.
2. Implementation Steps
Step 1: Create the Virtual Private Cloud (VPC)
- Navigate to the VPC Console in AWS.
- Select Create VPC and choose VPC Only.
- Name the VPC (e.g., Lab-VPC) and assign the IPv4 CIDR block 10.0.0.0/16.
- Leave IPv6 disabled and keep tenancy as Default.
Step 2: Provision Public & Private Subnets
- Under the VPC Dashboard, select Subnets \rightarrow Create Subnet.
- Select Lab-VPC as the target VPC.
- Public Subnet:
- Name: Public-Subnet-1
- Availability Zone: Select your primary AZ (e.g., us-east-1a).
- CIDR Block: 10.0.1.0/24
- Private Subnet:
- Name: Private-Subnet-1
- Availability Zone: Select the same AZ (or a second AZ for high availability).
- CIDR Block: 10.0.2.0/24
Step 3: Attach the Internet Gateway (IGW)
- Navigate to Internet Gateways \rightarrow Create Internet Gateway.
- Name it Lab-IGW and create it.
- Select the created IGW, click Actions, and choose Attach to VPC.
- Select Lab-VPC to associate the gateway with your network.
Step 4: Configure Route Tables & Routing Logic
- Go to Route Tables \rightarrow Create Route Table.
- Create a custom route table named Public-RT associated with Lab-VPC.
- Select Public-RT, navigate to the Routes tab, and click Edit Routes.
- Add the following entry:
- Destination: 0.0.0.0/0
- Target: Internet Gateway (Lab-IGW)
- Navigate to Subnet Associations \rightarrow Edit Subnet Associations and select Public-Subnet-1.
Note: The main/default route table associated with Private-Subnet-1 will not have a route to 0.0.0.0/0 via the IGW, ensuring that private resources remain inaccessible directly from the internet.
3. Verification & Connectivity Testing
To confirm the network architecture works as expected:
- Launch an EC2 instance inside Public-Subnet-1 with auto-assigned public IP enabled.
- Launch a second EC2 instance inside Private-Subnet-1.
- SSH into the public EC2 instance, then attempt to ping the private IP of the second instance (10.0.2.x).
- Confirm successful internal connectivity between subnets via local VPC routing (10.0.0.0/16 local target).
4. Key Takeaways
- Isolation: Keeping databases and backend application logic in private subnets minimizes exposure to external threats.
- Explicit Routing: Subnets only become "public" when explicitly routed to an Internet Gateway via a custom route table.
- Scalability: Assigning a /16 CIDR block allows room for expanding into multi-AZ deployments in future iterations.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article