Beginner 25 min read Module 3 of 8

S3 - Cloud Storage

S3 (Simple Storage Service) is Amazon's cloud storage. Think of it as a massive hard drive in the cloud that never runs out of space.

What is S3?

S3 is a storage service that lets you store and retrieve any amount of data from anywhere in the world. It's like a hard drive that's always online, never breaks, and can store anything.

5 GB of free storage
99.999999999% durability (11 nines!)
Host websites for free
Store photos, videos, documents, anything!

Your Second Mission: Host a File

  1. Go to S3: Type S3 in the search bar and click it.
  2. Click "Create bucket" (the orange button).
  3. Give it a unique name: my-test-bucket-2026-yourname (no two people on Earth can have the same bucket name).
  4. UNCHECK the box that says "Block all public access". (A warning will pop up; just acknowledge it).
  5. Click "Create bucket" at the bottom.
  6. Upload a file: Click into your new bucket → "Upload" → drag a photo (like cat.jpg) → click "Upload".
  7. Find the URL: Click on your uploaded file's name → scroll down → you will see an "Object URL". Copy it and paste it into a new browser tab.
  8. You will get an "Access Denied" error. That's good! It means your file is private.
  9. Make it public: Click the "Permissions" tab → "Object Ownership" → "Edit" → check "ACLs enabled". Scroll down to "Access Control List (ACL)" → click "Grant public read access" to "Everyone".
  10. Now copy the Object URL again and paste it in your browser. You see your cat photo! You just hosted a file on the internet!

Bonus: Host a Static Website for FREE

S3 can host static websites (HTML, CSS, JavaScript) for free. Here's how:

  1. Create a bucket with the same name as your domain (e.g., mywebsite.com)
  2. Enable "Static website hosting" in the Properties tab
  3. Set index.html as the index document
  4. Upload your HTML files
  5. Make them public
  6. Visit your bucket URL and see your website live!
Pro Tip: You can use S3 with CloudFront to add HTTPS and a custom domain!

Key S3 Concepts

Concept Description
Bucket A container for your files (globally unique name)
Object A file stored in a bucket
Key The name of the file (can include folders like images/cat.jpg)
ACL Access Control List - who can access your files
Bucket Policy A JSON document that controls permissions
Versioning Keep multiple versions of files for rollback

Exercise: Create a Photo Gallery

Task: Create a public photo gallery using S3.

  1. Create a bucket with a unique name.
  2. Disable "Block all public access" for the bucket.
  3. Enable static website hosting.
  4. Upload 5-10 photos to the bucket.
  5. Make each photo public.
  6. Create a simple HTML page that displays all photos.
  7. Upload the HTML page to the bucket.
  8. Visit your website URL and see your photo gallery!
Key Takeaway

S3 is AWS's storage service. You get 5 GB for free for 12 months. You can store any type of file and even host static websites. Remember to delete your buckets when you're done!