Hosting a Static Website on AWS S3 with Route 53 (HTTP) & CloudFront (HTTPS)
This document outlines the steps to host a static website on Amazon S3 and configure it with a custom domain using Route 53. Important: This configuration serves your website over HTTP (not secure). For HTTPS, you’ll need to use CloudFront, which is covered in a separate document.
Prerequisites
- An AWS account.
- A registered domain name (if you want to use a custom domain).
Steps
- 
Create an S3 Bucket: - In the AWS Management Console, navigate to the S3 service.
- Click “Create bucket.”
- Choose a bucket name that ideally matches your domain name (e.g., yourdomain.com). This simplifies configuration later.
- Select the desired AWS region.
- Under “Block all public access,” uncheck all the boxes. This is necessary for static website hosting. A more secure approach using bucket policies is used later.
- Click “Create bucket.”
 
- 
Enable Static Website Hosting: - Select the newly created bucket.
- Go to the “Properties” tab.
- Scroll down to “Static website hosting” and click “Edit.”
- Select “Enable.”
- In the “Index document” field, enter the name of your main HTML file (e.g., index.html).
- Optionally, you can specify an “Error document” (e.g., error.html).
- Click “Save changes.”
 
- 
Configure Bucket Policy: - 
Go to the “Permissions” tab of your S3 bucket. 
- 
Under “Bucket policy,” click “Edit.” 
- 
Paste the following bucket policy, replacing BUCKET-NAMEwith the actual name of your bucket:{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::BUCKET-NAME/*" } ] }
- 
Click “Save changes.” This policy allows public read access to the objects in your bucket. 
 
- 
- 
Configure Route 53 (for Custom Domain): - Navigate to the Route 53 service in the AWS Management Console.
- Go to “Hosted zones.”
- If you don’t have a hosted zone for your domain, create one.
- Select your hosted zone.
- Click “Create record.”
- Choose “Simple routing.”
- In the “Record name” field, enter the subdomain (e.g., www) or leave it blank for the root domain.
- Choose “Alias to S3 website endpoint.”
- Select the region where you created your S3 bucket.
- Select your S3 bucket.  The “Value” field will be automatically populated with the correct S3 website endpoint (e.g., s3-website.us-east-2.amazonaws.com).
- Click “Create records.”
 
- 
Upload Website Files: - Upload your website files (HTML, CSS, JavaScript, images, etc.) to your S3 bucket.
 
- 
Test Your Website: - After a short while (DNS propagation can take some time), you should be able to access your website using your custom domain (e.g., www.yourdomain.com).
 
- After a short while (DNS propagation can take some time), you should be able to access your website using your custom domain (e.g., 
Important Note: HTTP (Not Secure)
This configuration serves your website over HTTP. This means the connection is not encrypted, and user data could be vulnerable. For a secure website (HTTPS), you must use AWS Certificate Manager (ACM) & preferably CDN-Amazon CloudFront. Instructions for configuring HTTPS with CloudFront and your ACM certificate is provided below.