All labs
beginnerAWS
Host a Website on AWS S3
Stay safe and cost-free
S3 static hosting is practically free for learning (fractions of a cent), and falls entirely within the 12-month AWS Free Tier. However, cloud accounts CAN incur charges if misconfigured or forgotten. Set a billing alert in Step 1, ONLY create the resources instructed, and strictly follow the Cleanup step at the end. NEVER share or upload your AWS Access Keys.
You will learn to
- Configure AWS Billing Alerts to prevent surprise charges
- Create and configure an Amazon S3 Bucket
- Upload files to Object Storage
- Configure Bucket Policies for public read access
- Enable static website hosting and access the public URL
- Perform resource cleanup to maintain zero-cost infrastructure
Before you start
- An AWS account (free to create)
- A simple HTML file (make one in the Code Sandbox)
- AWS Free Tier account
- AWS Management Console (browser)
Step-by-step
1. Set a billing alarm (Crucial First Step)
Done when: A budget alert is active and tracking your account spend2. Make a simple web page
Done when: You have a local file named index.html ready to upload3. Create an S3 bucket
Done when: An empty bucket is created with public access unblocked4. Upload your index.html
Done when: index.html is listed in the Objects tab of your bucket5. Enable Static Website Hosting
Done when: Static website hosting is enabled and you have your endpoint URL6. Attach a Public Read Bucket Policy
Done when: The bucket policy is saved and the bucket is marked "Public"7. View your live website
Done when: Your webpage loads successfully via the AWS endpoint URL8. Clean up to stay free
Done when: The bucket and its contents are entirely deleted from AWS
Finished every step?
Reflect
- Why did we have to unblock public access AND add a bucket policy?
- What is the difference between an S3 "bucket" and an "object"?
- Why is setting a billing alarm the first step of any cloud project?