Skip to content
EgyKode
03 · AWS by handLab 15 / 59
Guided labaws

AWS VPC Networking by Hand

Build the network by hand so the Terraform version stops being magic — and find out what actually makes a subnet public.

Time
55 min
Level
Beginner
Objectives
4 objectives
Cost
Low cost

Where this fits in the platform

Before you start

You will need

  • AWS CLI v2, configured
  • An AWS account

You will be able to

  • Explain what makes a subnet public, in terms of the route table
  • Distinguish a security group from a NACL by their statefulness
  • Reach an instance in a private subnet without a public IP

CostLow cost

— a VPC, subnets, an Internet Gateway and one `t3.micro`. No NAT Gateway is created, deliberately: it is the one resource here that bills hourly.

How to clean up

The scenario#

The Terraform VPC lab produces a working network in one command, which is the point of Terraform and also the problem: nothing about it explains why it works.

Build the same thing by hand once, and every later terraform apply becomes readable.

Hands-on environment

Run it on AWS

This lab builds real cloud infrastructure, so it needs your own AWS account. Follow the cost and cleanup notes above — the resources are yours, and so is the bill.

Anything you tick here is your own record. EgyKode cannot see inside that terminal, so the success criteria stay self-assessed even when the environment checks your work for you.

The VPC and two subnets

Step 1 of 5

Clean up#

Run this even if you did not finish.

DestructiveThis removes real resources. Check which environment you are in first.

Terminal
aws ec2 terminate-instances --instance-ids <ids>
aws ec2 delete-subnet --subnet-id <id>   # both subnets
aws ec2 detach-internet-gateway --internet-gateway-id <igw> --vpc-id <vpc>
aws ec2 delete-internet-gateway --internet-gateway-id <igw>
aws ec2 delete-vpc --vpc-id <vpc>
aws ec2 describe-vpcs --query 'Vpcs[?!IsDefault].VpcId'   # should be empty

Cost of this lab: Free tier — a VPC, subnets, an Internet Gateway and one t3.micro. No NAT Gateway is created, deliberately: it is the one resource here that bills hourly.

Success criteria

0 of 4

The concept behind it

Ready to try it without help?Do the challenge

Next up

Lab 15 of 59 on the project path

Static Site on S3 + CloudFrontServe a site from a private bucket through a CDN with HTTPS, correct cache headers, and a cleanup you actually run.55 minBeginner

Previous: AWS IAM & Least Privilege