AWS Builder Center
AWS Cloud Quest: VPC Networking & Subnet Routing

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)

  1. Navigate to the VPC Console in AWS.
  1. Select Create VPC and choose VPC Only.
  1. Name the VPC (e.g., Lab-VPC) and assign the IPv4 CIDR block 10.0.0.0/16.
  1. Leave IPv6 disabled and keep tenancy as Default.

Step 2: Provision Public & Private Subnets

  1. Under the VPC Dashboard, select Subnets \rightarrow Create Subnet.
  1. Select Lab-VPC as the target VPC.
  1. Public Subnet:
  • Name: Public-Subnet-1
  • Availability Zone: Select your primary AZ (e.g., us-east-1a).
  • CIDR Block: 10.0.1.0/24
  1. 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)

  1. Navigate to Internet Gateways \rightarrow Create Internet Gateway.
  1. Name it Lab-IGW and create it.
  1. Select the created IGW, click Actions, and choose Attach to VPC.
  1. Select Lab-VPC to associate the gateway with your network.

Step 4: Configure Route Tables & Routing Logic

  1. Go to Route Tables \rightarrow Create Route Table.
  1. Create a custom route table named Public-RT associated with Lab-VPC.
  1. Select Public-RT, navigate to the Routes tab, and click Edit Routes.
  1. Add the following entry:
  • Destination: 0.0.0.0/0
  • Target: Internet Gateway (Lab-IGW)
  1. 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:
  1. Launch an EC2 instance inside Public-Subnet-1 with auto-assigned public IP enabled.
  1. Launch a second EC2 instance inside Private-Subnet-1.
  1. SSH into the public EC2 instance, then attempt to ping the private IP of the second instance (10.0.2.x).
  1. 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.
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