AWS Hands-On Lab — Project #1 — Foundation

Lab 01: S3 Static Website Hosting

Create an Amazon S3 bucket, enable static website hosting, upload your HTML files, and configure a public bucket policy. Your first live website on AWS — no servers required.

Services: Amazon S3 · IAM    Cost: ~$0 Free Tier    Time: 1–2 hours    Level: Beginner

Overview

Amazon S3 (Simple Storage Service) can host entire static websites. When you enable static website hosting on a bucket, S3 serves your HTML, CSS, and JavaScript files directly to anyone who visits the endpoint URL — no EC2 instance, no web server, no OS to patch.

This is Lab 01 of the AWS Cloud Practitioner study series. In Lab 02 you will add a custom domain and HTTPS using Route 53 and CloudFront.

Architecture

  1. User opens the S3 website endpoint URL in their browser
  2. S3 finds the requested file in the bucket (defaults to index.html)
  3. The IAM bucket policy allows public read — anyone can access the files
  4. Your HTML page is returned and rendered in the browser over HTTP

AWS Services Used

ServicePurposeFree Tier
Amazon S3Stores and serves HTML, CSS, and image files as a static websiteYes
AWS IAMBucket policy grants public read access so visitors can load pagesYes
Free Tier: Amazon S3 includes 5 GB storage, 20,000 GET requests, and 2,000 PUT requests per month at no charge. A basic static website costs effectively $0 per month.

Prerequisites

If you do not have an HTML file ready, start with a simple one-liner — <h1>Hello, AWS Cloud!</h1> — saved as index.html. You can replace it with a polished page later.

Step 1
AWS Management Console
Sign In and Navigate to S3

Sign into the AWS Console and select the correct region before creating any resources.

  1. Go to console.aws.amazon.com and sign in
  2. In the top-right corner click the region dropdown
  3. Select US East (N. Virginia) — us-east-1
  4. In the top search bar type S3 and click S3
S3 is a global service — your bucket list shows buckets from all regions. However, each bucket is physically located in one region. Choosing us-east-1 is required for CloudFront compatibility in Lab 02.
Step 2
Amazon S3
Create Your S3 Bucket

An S3 bucket is a container for your files. Bucket names must be globally unique across all of AWS.

  1. On the S3 console click Create bucket
  2. Under Bucket name enter a unique name e.g. fredloomis-aws-lab-01
  3. Under AWS Region confirm us-east-1 is selected
  4. Under Object Ownership leave the default: ACLs disabled
  5. Under Block Public Access settingsuncheck Block all public access
  6. Check the acknowledgment checkbox that appears
  7. Leave all other settings at defaults and click Create bucket
Naming rules: Names must be globally unique, lowercase, 3–63 characters, letters, numbers, and hyphens only. If your name is taken, add initials or a date: fl-aws-lab01-2026
Step 3
Amazon S3 — Properties Tab
Enable Static Website Hosting

By default S3 serves objects as file downloads. Enabling Static Website Hosting switches S3 into a mode where it routes browser requests to your HTML files.

  1. Click on your bucket name to open it
  2. Click the Properties tab
  3. Scroll to the bottom — find Static website hosting and click Edit
  4. Select Enable
  5. Hosting type: Host a static website
  6. Index document: index.html
  7. Error document: error.html
  8. Click Save changes
  9. Scroll back down — copy and save the Bucket website endpoint URL that now appears
The Index document is the default page served when someone visits the root of your site. The Error document is served when a visitor requests a page that does not exist.
Step 4
AWS IAM — Bucket Policy
Add a Public Read Bucket Policy

A bucket policy is a JSON document that defines who can access your bucket. For a public website you need to allow anyone to perform the s3:GetObject action.

  1. Click the Permissions tab on your bucket
  2. Scroll to Bucket policy and click Edit
  3. Delete any existing content and paste the following JSON — replacing YOUR-BUCKET-NAME with your actual bucket name:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadGetObject",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
    }
  ]
}
  1. Click Save changes
  2. A red Publicly accessible badge will appear on your bucket — this confirms the policy is active
Important: The Resource line must end with /*. Without it, files will still return Access Denied errors even with the policy saved.
Step 5
Amazon S3 — Objects Tab
Upload Your Website Files
  1. Click the Objects tab on your bucket
  2. Click UploadAdd files
  3. Select your index.html file (and error.html if you have it)
  4. Leave all other settings as default and click Upload
  5. Wait for the green success banner then click Close

Optional: Upload via AWS CLI

# Upload a single file
aws s3 cp index.html s3://your-bucket-name/

# Upload all files in a folder
aws s3 sync ./website/ s3://your-bucket-name/ --delete
Step 6
Web Browser
Test Your Live Website
  1. Go back to the Properties tab → scroll to Static website hosting
  2. Click the Bucket website endpoint URL
  3. Your index.html page should load in the browser
  4. Test the error page: add /fakepage.html to the URL — your error.html should appear
Your site is live on AWS! The URL uses HTTP, not HTTPS. To add HTTPS and a custom domain, proceed to Lab 02.

Common issues

ProblemCauseFix
403 Access DeniedBucket policy missing or incorrectRe-check Step 4 — Resource must end with /*
404 Not Foundindex.html not uploaded or misspelledCheck the Objects tab — confirm index.html exists
NoSuchWebsiteConfigurationStatic website hosting not enabledRe-check Step 3 — ensure hosting is set to Enable
CSS or images missingSupporting files not uploadedUpload all CSS, JS, and image files to the bucket

Verification Checklist


What You Learned


Lab Cleanup — Delete Your Resources

If you plan to continue to Lab 02, keep this bucket — Lab 02 builds on it. If you are done, delete the resources below.
#ResourceHow to Delete
1S3 Bucket ObjectsS3 → bucket → Objects tab → select all → Delete → type permanently delete
2S3 BucketS3 → bucket list → select bucket → Delete → type bucket name → confirm
S3 buckets cannot be deleted unless completely empty. Always empty the bucket first, then delete it.