DEV Community

Cover image for 🌐 AWS 103: Mapping Your Cloud Neighborhood - Creating Your First Subnet
Hritik Raj
Hritik Raj

Posted on

🌐 AWS 103: Mapping Your Cloud Neighborhood - Creating Your First Subnet

πŸ—ΊοΈ AWS Subnets: The Foundation of Your Cloud Network

Hey Cloud Geeks and Network Enthusiasts! πŸ‘‹

Welcome to Day 3 of the #100DaysOfCloud Challenge: Create Subnet! We’re marching forward in our journey of breaking down massive cloud migration tasks into simple, systematic steps, following the plan from the awesome folks at KodeKloud Engineer.

KodeKloud Engineer

We've secured our access (Key Pair) and set up our virtual firewall (Security Group). Now, it’s time to define the actual location where our future servers will reside: the Subnet!


1. Introduction: Understanding Subnets πŸ’‘

Think of your VPC (Virtual Private Cloud) as your own private house in the cloud. A Subnet is a room inside that house.

  • What it is: A Subnet is a contiguous range of IP addresses within your VPC, dedicated to a single Availability Zone (AZ).
  • Availability Zone: An AZ is one or more discrete data centers in a region, designed to be isolated from failures in other AZs. A Subnet can never span multiple AZs.
  • Why it Matters: Subnets allow you to logically segment your network. For example, you can put web servers in a "Public Subnet" and database servers in a "Private Subnet" for enhanced security and control.

For this task, we will create a single Subnet named nautilus-subnet under the default VPC. AWS automatically assigns an available IP range when you create a Subnet in the default VPC, simplifying the process for us!

Let's carve out our space in the cloud! πŸ“


2. Step-by-Step Guide: Creating the Nautilus Subnet via AWS Console

We will use the AWS Management Console, specifically the VPC Dashboard, to provision our new network segment.

Step 2.1: Navigate to the VPC Dashboard

Subnets are managed directly within the VPC service.

  1. Log in to the AWS Console.
  2. In the AWS console search bar, type VPC and click on the first result to open the VPC Dashboard.

  1. In the left-hand navigation menu, scroll down and click on "Subnets".

Step 2.2: Initiate Subnet Creation

  1. Click the orange "Create subnet" button.

Step 2.3: Configure VPC and Subnet Details

This is where we define the Subnet's parent network and location.

  1. VPC ID: Select your Default VPC. (This VPC is already provisioned by AWS when your account is created.)

  2. Add new subnet: Click this button if it's not already expanded.

    • Availability Zone: Select any available AZ in your region (e.g., us-east-1a). Remember, a Subnet lives in only one AZ.
    • Subnet name: Enter the required name: nautilus-subnet
    • IPv4 CIDR block: Since we are using the Default VPC, AWS will suggest or automatically select an available CIDR range for you based on the Default VPC's main CIDR. You may need to click "Specify an IPv4 CIDR block" and enter a specific range if prompted, but usually, selecting the AZ is enough in a default VPC environment. If a CIDR is required, select an available range like 172.31.32.0/20.

Step 2.4: Finalize and Create

  1. Review your settings to ensure the VPC is correct and the Subnet name is nautilus-subnet.
  2. Click the "Create subnet" button at the bottom.

You have now successfully defined a dedicated network space for your application servers within a specific Availability Zone! Fantastic work! πŸŽ‰


3. Key Takeaways πŸ“

  • 1:1 AZ Mapping: A Subnet must belong to exactly one Availability Zone.
  • Networking Blocks: Subnets define the IP address range available for the servers you launch inside them.
  • Default VPC Simplicity: Using the Default VPC simplifies CIDR block allocation, as the primary range is already defined.

4. Common Mistakes to Avoid 🚫

  1. Wrong VPC: Creating the Subnet in the wrong VPC (especially if you have multiple custom VPCs). Always double-check the VPC ID!
  2. Naming Confusion: Subnets are often named based on their purpose (e.g., app-tier-public) and their AZ (e.g., us-east-1a). While we only needed nautilus-subnet, in production, use clear naming conventions.
  3. Running out of IPs: CIDR blocks are limited. If you choose a small block like /28, you only get 16 IPs, and AWS reserves the first four and the last one, meaning you only get 11 usable IPs.

5. Conclusion + Call to Action! 🌟

You've successfully mapped out the infrastructure location for the Nautilus team! By creating this Subnet, you’ve set the stage for launching the actual computing resources. You're building a network from the ground up!

Keep the momentum going! If you found this guide helpful, please:

  • πŸ’¬ Let’s connect on LinkedIn: Cloud, DevOps, consistency, and learning in publicβ€”let’s build together!
    πŸ‘‰ Hritik Raj

  • ⭐ Support my journey on GitHub: Follow my #100DaysOfCloud challenge with real AWS tasks and hands-on learning
    πŸ‘‰ GitHub – 100 Days of Cloud

Next up, we'll continue configuring the network, likely ensuring this Subnet is properly routed to the internet! Happy networking! πŸ’»

Top comments (0)