AWS Certified Cloud Practitioner / Amazon S3

S3 Website Overview

🌐 Amazon S3 β€” Static Website Hosting

πŸ“Œ Overview

  • S3 can host static websites (HTML, CSS, JS, images) and make them accessible over the internet.

  • No server needed β€” S3 serves the files directly.

πŸ”— Website URL Format

Depends on the AWS region:

Format

Example

Dash format

http://bucket-name.s3-website-aws-region.amazonaws.com

Dot format

http://bucket-name.s3-website.aws-region.amazonaws.com

  • Both work the same way β€” only difference is a dash vs a dot before the region.

  • No need to memorize which one; just recognize both are valid. βœ…


βš™οΈ How It Works

  1. πŸͺ£ Create an S3 bucket, upload your website files (HTML, images, etc.)

  2. πŸ”§ Enable Static Website Hosting on the bucket

  3. 🌍 Access the site via the generated URL (e.g., demo-bucket in us-west-2)


🚫 Important: Public Access Required

  • Static website hosting will not work unless the bucket allows public reads.

  • ⚠️ If you get a 403 Forbidden error β†’ the bucket is not public yet.

  • βœ… Fix: Attach an S3 Bucket Policy that allows public GetObject access.


🎯 Key Takeaway

Enabling static website hosting alone isn't enough β€” you must also attach a bucket policy allowing public reads, or visitors will get a 403 error. πŸ”“