Quiz
Warm-up from lesson 3-3: a fresh security group has no inbound rules. What can reach the instance?
Storage without a disk
An EC2 instance stores files on its attached disk, and that disk has problems as a home for important data: it has a fixed size, it lives in one AZ, and if the instance dies badly the data can die with it.
S3 (Simple Storage Service) is a different model called object storage. You do not get a disk. You get an API with roughly two verbs, put this file, get this file:
- A bucket is a named container for files. Bucket names are globally unique across every AWS account on Earth, because they appear in URLs.
- An object is one stored file plus metadata, up to 5 TB.
- A key is the object's full name inside the bucket, like
cats/whiskers.jpg.
S3 automatically stores every object on multiple devices across at least 3 AZs (lesson 1-2 pays off). It is designed for eleven nines of durability, meaning statistically you would wait millions of years to lose one object. Capacity is unlimited, and you pay per GB actually stored, about $0.023 per GB-month.
There are no folders
The key cats/whiskers.jpg looks like a folder path, but S3 is a flat name → object lookup, one giant dictionary. The slashes are just characters in the name that tools display as folders for your comfort.
Every object is addressable by bucket + key, in two spellings:
s3://my-app-photos/cats/whiskers.jpg (CLI style) https://my-app-photos.s3.us-east-1.amazonaws.com/cats/whiskers.jpg (HTTP style)
That second line matters: every object has a real URL. Whether the URL works for the public is a permissions question, coming next lesson.
Code exercise · bash
Run this to build both addresses for one object from its bucket and key.
Code exercise · bash
Your turn. Your invoicing app stores PDFs in the bucket acme-invoices, organized by year and month. Build both addresses for June 2026's invoice number 1042, key 2026/06/invoice-1042.pdf.