Skip to content

AWS Infrastructure at a Glance (B3-1) ​

In the Codyssey B3-1 mission, I built the network on AWS from scratch, put an Nginx web server on it, and made it reachable from the outside. This page gives a quick tour of the overall structure and concepts first; for details, see the article for each concept.

What Was Built ​

I created a new VPC in the AWS Seoul region, launched one EC2 instance in a public subnet inside it, and had Nginx serve a web page and a health check (/health). The security group opens only the ports that are needed, and the IAM user used for the work has only the permissions the lab requires. Setup and cleanup were automated with AWS CLI shell scripts.

B3-1 architecture: from the internet through the IGW, route table, public subnet, and security group to Nginx on EC2Figure: B3-1 architecture. DENY in the IAM box on the right means it is blocked because it was not put on the allow list, not that a separate Deny statement was written in the policy.

ComponentNameSetting
VPCcloud-lab-vpc10.0.0.0/16
Public subnetcloud-lab-public-subnet10.0.1.0/24 (ap-northeast-2a)
Internet gatewaycloud-lab-igwAttached to the VPC
Route tablecloud-lab-public-rt0.0.0.0/0 → IGW
Security groupcloud-lab-web-sgHTTP 80 for everyone, SSH 22 for my IP only
EC2cloud-lab-web-servert2.micro, Ubuntu 22.04 LTS
Web serverNginxPort 80, responds on /health

The Path of an Incoming Request ​

User (internet)
 → Internet gateway (the VPC's entrance)
 → Route table (0.0.0.0/0 → IGW)
 → Public subnet (10.0.1.0/24)
 → Security group (TCP 80 allowed?)
 → EC2 → Nginx → response

If even one of these is missing, the server can't be reached from the outside. So when the connection fails, check them one by one in this order.

One-Line Concept Summary ​

ConceptOne-line meaningDetails
Region / Availability ZoneAn area where AWS data centers are located / an independent group of data centers within that areaVPC and Subnets
VPCYour own isolated network inside AWSVPC and Subnets
CIDRA way of writing a network's IP range, like 10.0.0.0/16VPC and Subnets
SubnetAn IP section carved out of a VPC. There are public and private onesVPC and Subnets
Internet gatewayThe entrance that connects a VPC to the internetInternet Gateway and Routing
Route tableA table listing where to send packets for each destinationInternet Gateway and Routing
NAT gatewayA device that lets a private subnet only go out to the internetInternet Gateway and Routing
Security groupA firewall in front of an instance that filters incoming and outgoing trafficSecurity Groups and NACLs
NACLA firewall that filters traffic at the subnet levelSecurity Groups and NACLs
IAMPermission management that decides who can do which AWS actionsIAM and Least Privilege
Principle of least privilegeGranting only the permissions a job really needsIAM and Least Privilege
EC2 / AMIAWS's virtual server / the OS image used to stamp out serversEC2 and Nginx Health Checks
Key pairThe public/private key pair used to SSH into EC2EC2 and Nginx Health Checks
Health checkChecking whether a server is alive through a fixed addressEC2 and Nginx Health Checks
Hypothesis-driven troubleshootingListing candidate causes and ruling them out one by oneTroubleshooting and Resource Cleanup
Resource cleanupDeleting things in order after the lab so no charges are incurredTroubleshooting and Resource Cleanup

What B3-1 Left Behind ​

ItemContents
Scriptssetup-iam.sh (IAM user and policy), setup-infrastructure.sh (from VPC to EC2), cleanup-infrastructure.sh (bulk deletion by tag)
DocumentsTroubleshooting report (3 cases), resource cleanup checklist, WHY analysis, architecture diagram
Verificationcurl http://<public-IP>/health → 200, OK
Biggest limitationOne server in one AZ, so if the server dies, the service stops. Uses only HTTP, no HTTPS

Source: Codyssey-B1/B3-1