Quiz
Warm-up from lesson 2-3: your program on a cloud server needs AWS permissions. What should hold them?
EC2
EC2 (Elastic Compute Cloud) is the rent-a-server service, the concrete version of everything in unit 1. One rented server is an instance. EC2 is the oldest and most-used compute service on AWS: most production software that is not serverless runs on EC2 or on services built on top of it, so launching, sizing, and securing instances is week-one work on real infrastructure teams.
An instance is a virtual machine (VM): software that behaves exactly like a physical computer. A layer called a hypervisor runs on AWS's real hardware and slices it into many isolated VMs, each with its own share of CPU, RAM, and its own operating system.
Here is the Docker connection. A container shares the host's operating system kernel and isolates just your process. A VM goes deeper and virtualizes the whole machine, its own kernel included. That makes VMs heavier but more isolated, which is why AWS can safely rent slices of one physical box to complete strangers. In practice you often run both: an EC2 instance as the host, your Docker containers on top of it.
When you launch an instance you pick three things: an AMI (Amazon Machine Image), the disk template it boots from (like "Ubuntu 24.04"), an instance type (the size), and the region and AZ it lives in, from lesson 1-2.
Code exercise · bash
Instance types are compact codes: family, generation, size, like t3.micro. The family letter states the job (t = tiny burstable, m = general, c = compute-heavy, r = RAM-heavy). Run this to split a type into its parts using bash string slicing.
Reading the catalog
Sizes scale by doubling: micro → small → medium → large → xlarge → 2xlarge and beyond, each step roughly doubling vCPUs, RAM, and price.
| type | vCPUs | RAM | rough price |
|---|---|---|---|
| t3.micro | 2 | 1 GB | ~$7.50/mo |
| t3.large | 2 | 8 GB | ~$61/mo |
| m5.xlarge | 4 | 16 GB | ~$140/mo |
| c5.2xlarge | 8 | 16 GB | ~$248/mo |
A t3.micro comfortably runs a hobby web app. Real workloads get measured, then sized, and thanks to elasticity from lesson 1-3 you can resize later with a reboot instead of buying a new machine.
Code exercise · bash
Your turn. A teammate asks what c5.2xlarge means. Change the script to split that type and print the same three lines for it.