- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
Deploy a Static Website using Amazon S3 Website Hosting
In this hands-on lab, you’ll deploy a simple static website using Amazon S3 Website Hosting. You’ll create a uniquely named S3 bucket, and enable static website hosting by configuring the required index and error documents. You’ll begin with Block Public Access enabled, then intentionally adjust access settings and apply a least-privilege bucket policy that allows only public read (s3:GetObject) to your website content. Finally, you’ll validate the deployment by opening the S3 website endpoint URL and confirming the site loads successfully in a browser.
Lab Info
Table of Contents
-
Challenge
Create a S3 Bucket for Website Hosting
- Create a new S3 bucket with a globally unique name in a selected Region
- Confirm Block Public Access is enabled initially (default posture)
-
Challenge
Upload Static Site Files
- Download the index.html and error.html files from the GitHub resources.
- Upload index.html and error.html files to the S3 bucket root (top level)
-
Challenge
Enable S3 Website Hosting
- Enable Static website hosting on the bucket
- Set Index document to index.html
- Set Error document to error.html
- Copy the Bucket website endpoint URL for later validation
-
Challenge
Configure Public Read Access Safely
- Disable “Block all public access” only as required to serve the website
- Copy the least-privilege s3 bucket policy form the s3bucketpolicy.json file, from the GitHub resources, so that only s3:GetObject is allowed on the S3 bucket. (Note: When pasting your AWS ARN into the s3bucketpolicy.json code
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*", be sure to keep the/*at the end of the ARN.)
-
Challenge
Verify the Website
- Open the S3 website endpoint URL in a browser
- Confirm index.html renders successfully
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.