Set Up Your VPC Basics

We’re repeating our steps from the first networking project to set up our VPC, subnet, and internet gateway. Let’s go!


Visualize Your Network (Mermaid Diagram)

This diagram helps visualize the basic structure we’re setting up: a VPC with a public subnet connected to an internet gateway.


Create a VPC

Your VPC is the foundation for the rest of this project and represents your corner of the AWS Cloud.

Steps:

  1. Log in to your AWS Account.
  2. Head to your VPC console.

πŸ’‘ What is a VPC? A Virtual Private Cloud (VPC) is like managing your own city inside the AWS Cloud. You design neighborhoods (subnets), traffic rules, and security measures, giving you full privacy and control over how your resources work together.

  1. Create a VPC with the following settings:
    • Name tag: NextWork VPC
    • IPv4 CIDR: 10.0.0.0/16

πŸ’‘ What is a CIDR block? CIDR assigns a block of IP addresses. The number after the slash determines the size of the block:

  • /16: 65,536 addresses
  • /24: 256 addresses
  • /8: 16,777,216 addresses
  1. Click Create VPC.

Create Subnets

Now that we have our VPC, let’s create a public subnet.

Steps:

  1. In your VPC console, select your NextWork VPC.
  2. Create a subnet with the following details:
    • VPC ID: NextWork VPC
    • Subnet name: Public 1
    • Availability Zone: First in the list
    • IPv4 Subnet CIDR block: 10.0.0.0/24

πŸ’‘ Is my Public 1 subnet a public subnet? Not yet! A public subnet requires a route to an internet gateway. We’ll attach one shortly.

  1. Enable the auto-assign public IPv4 address setting for the subnet.

πŸ’‘ Why enable auto-assign public IPv4 address? This automatically assigns a public IP to any EC2 instance launched in the subnet, making it internet-accessible without manual IP assignment.


Create an Internet Gateway

Steps:

  1. Go to the Internet Gateway section in the VPC console.
  2. Create an internet gateway with the following settings:
    • Name tag: NextWork IG
  3. Attach the internet gateway to your NextWork VPC.

πŸ’‘ What does attaching an internet gateway mean? This allows resources in your VPC to access the internet and makes public instances reachable from outside.


Create a Route Table

Even though we’ve attached an internet gateway, we still need to configure a route table to direct traffic.

Steps:

  1. Go to the Route Tables section in the VPC console.
  2. Rename your NextWork VPC route table to NextWork Route Table.
  3. Add a new route with the following settings:
    • Destination: 0.0.0.0/0

πŸ’‘ Why 0.0.0.0/0? This represents all IPv4 addresses, creating a default route for internet-bound traffic.

  1. Target: Select the internet gateway you created.
  2. Associate the route table with your Public 1 subnet.

🚨 Important: Without a route table linked to an internet gateway, your subnet remains private and cannot communicate with the internet.


Create a Security Group

Lastly, we’ll add a security group to control access to resources in the VPC.

πŸ’‘ What is a security group? Think of it as a security checkpoint for resources. It controls inbound and outbound traffic based on rules for IP addresses, protocols, and port numbers.

Steps:

  1. Go to the Security Groups section in the VPC console.
  2. Create a security group with the following details:
    • Name tag: NextWork SG
    • VPC: NextWork VPC
  3. Configure inbound rules to allow:
    • Protocol: HTTP (port 80)
    • Protocol: SSH (port 22, for secure server access)
  4. Save the security group.

πŸ“§ Contact

For questions or feedback, reach out:

πŸ“¨ Email: projects@briankimemia.is-a.dev 🌐 Portfolio: Brian Kimemia GitHub: BrianKN019


Thank you for exploring this project! Let’s innovate and build secure AWS solutions together. πŸš€