We will be launching a static website on Amazon S3 and routing it using Route 53
Design
What do we need
- An S3 bucket
- A domain name (Purchase from Amazon Route 53)
What to do
- Create/Purchase a domain name using Amazon Route 53
- Create an S3 bucket
- Upload your website to your S3 bucket
- Enable static webste hosting on S3
- Attach a bucket policy
- Direct your domin to the S3 bucket
Steps to follow
- Create/Purchase a domain name using Amazon Route 53 Open AWS Console and Navigate to Amazon Route 53 dashboard
- Click on Register Domain
- Search if your Domain is available and add it to your cart
Enter your details and accept the terms and conditions
*Don't forget to disable automatic renewal
Create an S3 bucket
- Navigate to Amazon S3 dashboard and Create a bucket
- Use your domain name as the bucket name
- Choose a region closest to you
- Uncheck BLOCK PUBLIC ACCESS (so that the public can access it)
- Acknowledge the warning and leave others as defaults
- Click on create bucket
- Once it's done, click your bucket and select upload
Upload your website to your S3 bucket
- Click on Add files (Add from your computer)
- Select upload
Enable static website hosting on S3
- On the tab, Click on properties
- Scroll down and select STATIC WEBSITE HOSTING
- Change it to ENABLE and also change the index document (to your file name)
- Click SAVE CHANGES
Attach a bucket policy
- On the tab, click on PERMISSIONS
- Click edit and write a bucket policy
- Click save changes
Direct your domain to the S3 bucket
- Navigate to Route 53 dashboard
- Click on hosted zone
- Click on your domain name
- Click on create record and choose a simple routing policy
- Click next
- Click on Define simple record
- For the VALUE, type Alias to S3 website endpoint
- Choose the same region you host your bucket
- Select the S3 endpoint
- Set 'Evaluate target health' to NO
- Click Define simple record
- Create record and wait for few minute to reload your website
To watch a step-bystep video
Click HERE
Top comments (0)