S3 already showed up sideways in this curriculum — presigned URLs, lesson infographics hosted on it — without ever covering the service itself directly. This lesson closes that gap: buckets, keys, versioning, and the storage-class decision that quietly drives a meaningful chunk of a real AWS bill.
4 min read
An S3 bucket is a globally-uniquely-named container; an object is a file stored inside it, addressed by a key (its full path-like name within the bucket). That's the entire structural model — no real subdirectories exist underneath, despite the console showing a folder-like browsing experience (a key like photos/2024/vacation.jpg is one flat string; the "folders" are a UI convenience built from splitting on /, not actual nested directory objects, exactly as covered generically in the Cloud Computing domain's storage-types lesson).
aws s3 mb s3://my-app-uploads-unique-name
aws s3 cp photo.jpg s3://my-app-uploads-unique-name/photos/2024/photo.jpg
aws s3 ls s3://my-app-uploads-unique-name/photos/2024/Bucket names are globally unique across all of AWS, not just within your account — a name someone else has already taken is unavailable to you, which is why real bucket names are usually suffixed with something distinguishing (a company name, a random string).
S3 buckets are private by default, and since 2018 AWS has layered Block Public Access settings on top that, by default, prevent a bucket from becoming public even if an individual object or bucket policy tries to grant it — a direct response to how common the "someone accidentally made a bucket public" incident used to be. Making a bucket genuinely public (for something like static website hosting) requires deliberately disabling Block Public Access at the bucket level and writing an explicit bucket policy granting read access — two separate steps, on purpose.
Versioning, once enabled on a bucket, keeps every previous version of an object instead of overwriting it — a PUT to an existing key creates a new version rather than replacing the old one, and a DELETE adds a "delete marker" rather than actually destroying the prior versions (which remain recoverable). This is the difference between "I overwrote the wrong file and it's gone forever" and "I overwrote the wrong file and can restore the previous version in seconds."
aws s3api put-bucket-versioning \
--bucket my-app-uploads-unique-name \
--versioning-configuration Status=EnabledVersioning isn't free — every version is billed as its own object — which is exactly why it pairs naturally with the lifecycle rules covered next.
Not all data needs to be instantly retrievable at the same cost. S3 offers multiple storage classes trading retrieval speed/cost against storage cost:
| Storage class | Retrieval | Storage cost | Typical use |
|---|---|---|---|
| Standard | Instant | Highest | Frequently accessed data |
| Standard-IA (Infrequent Access) | Instant | Lower, but a per-GB retrieval fee | Backups, older uploads accessed occasionally |
| Glacier Instant Retrieval | Instant | Much lower | Rarely accessed but needs instant access when it is |
| Glacier Flexible Retrieval | Minutes to hours | Very low | Archival, compliance retention |
| Glacier Deep Archive | Up to 12+ hours | Lowest | Long-term archival, rarely if ever retrieved |
A lifecycle rule automates moving objects between classes over time without any manual intervention:
{
"Rules": [{
"ID": "archive-old-uploads",
"Status": "Enabled",
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 365 }
}]
}This rule: keep new uploads in Standard for the first 30 days, move to Standard-IA at day 30, move to Glacier at day 90, delete entirely at day 365 — exactly the kind of automated storage-cost management referenced generically in the Cloud Computing domain's cost-optimization lesson.
Two capabilities worth knowing exist, beyond plain storage:
Check your understanding
A quick comprehension check — not tracked, not graded, just for you.
1. Does S3 have real nested directories/folders underneath its console view?
2. Why does making an S3 bucket genuinely public require two separate steps?
3. What does S3 versioning protect against?
4. What does an S3 lifecycle rule automate?
AWS