Intermediate 30 min read

Project: Host a Static Website on S3

By the end of this lesson, you'll be able to:

  • Walk through the full workflow of creating a bucket, uploading content, and enabling static website hosting
  • Apply this module's Versioning and cleanup discipline to a real, hands-on training bucket
  • Verify — not assume — that a training bucket and its contents are fully cleaned up

Prerequisites: "Comparing AWS Storage Services"

Before you begin: two valid paths, and a real cost decision

As with Module 3's project, you can follow this directly in a real AWS account or read through it without creating anything. If you do create a real bucket, check your AWS account's current Free Tier eligibility and the current S3 pricing page first — don't assume a small training bucket is automatically free, and remember Lesson 3's point that storage classes, and Versioning if you enable it, each carry their own cost characteristics.

The workflow, end to end

  1. Create or select a bucket — using the quarrydev-training-UNIQUE_SUFFIX naming pattern from Lesson 1, with your own unique, non-sensitive suffix.
  2. Upload a small static site — at minimum an index.html file, and optionally an error page.
  3. Inspect the uploaded object — confirm its key, size, and that it uploaded successfully.
  4. Reason about access — this bucket is a website, so enabling public read access to its content is the deliberate, narrow exception Lesson 4 discussed — not a default applied to every bucket.
  5. Optionally enable Versioning — upload a second version of index.html and observe that both versions now exist, per Lesson 3.
  6. Configure static website hosting — set the index document (and error document, if you added one).
  7. Test — request the site's website endpoint in a browser and confirm your page loads.

Working with the bucket from the command line (optional)

If you have the AWS CLI configured, the same steps can be done from a terminal instead of the Console — entirely optional, and not required to complete this project:

aws s3 ls
aws s3 cp example.txt s3://YOUR_BUCKET_NAME/example.txt

The first command lists your buckets, confirming your CLI is authenticated and working. The second uploads a local file (example.txt) to a specific bucket and key — replace YOUR_BUCKET_NAME with your own real bucket name (following Lesson 1's naming pattern), and never paste real AWS credentials into a command or commit them anywhere.

Cost & Cleanup

This project creates real, potentially billable resources if followed in a real account. Once you've confirmed the site works and you're done experimenting, work through this checklist — don't assume any single step handles everything:

  1. Review the objects in the training bucket.
  2. Review object versions, if you enabled Versioning in step 5 — per Lesson 3, a version can remain stored even after the "current" object appears deleted.
  3. Review delete markers, if any objects were deleted while Versioning was enabled.
  4. Delete training objects and versions you no longer need — all of them, not just the visible current version.
  5. Remove any lifecycle configuration you added, if it's no longer needed.
  6. Delete the training bucket itself once it's empty and you're finished with it.
  7. Confirm the bucket no longer exists by checking your account's S3 dashboard directly — the same "verify, don't assume" discipline Module 3 taught for EC2.

Listing your buckets (optional CLI check)

aws s3 ls

Lists the S3 buckets visible to your currently configured AWS CLI credentials. A quick way to confirm the CLI is authenticated and working before trying anything else — entirely optional if you're following along in the Console instead.

Uploading a file to a bucket (optional CLI check)

aws s3 cp example.txt s3://YOUR_BUCKET_NAME/example.txt

Uploads a local file (example.txt) to the given bucket at the key example.txt. Replace YOUR_BUCKET_NAME with your own real, unique bucket name — never a shared or guessable one — and never include real credentials in the command itself; the AWS CLI reads those from your existing configuration.

Exercise

You enabled Versioning during this project and later deleted the original index.html after uploading a second version. List every step from this lesson's Cost & Cleanup checklist that specifically addresses that situation — not just "delete the bucket."

Show hint

At least two checklist steps deal with this exact situation specifically, beyond the final bucket deletion.

Project: Host a Static Website on S3 Quiz

1. A learner finishes this project, deletes the visible objects in their training bucket, and immediately tries to delete the bucket itself — but S3 refuses because the bucket isn't empty. What's the most likely explanation, based on this module?

2. Deleting a bucket's visible objects is always sufficient to guarantee the bucket is empty, even with Versioning enabled.

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

This closing project ties the module together: create a bucket, upload a small static site, reason through access and versioning, enable static website hosting, test it, and then work through a full, verified cleanup — including the object-version details Lesson 3 specifically warned are easy to miss.