Introduction
This article explains how to use a S3 service to store our website files and make it a serverless static Website. With the help of Route 53 domain Routing, we can access our website using our own domain from anywhere.
Follow the steps:
Kick Start!!
Select S3 from AWS Management Console under the services.
In S3 Dashboard, click Create Bucket in name of your domain which you want a publish static website to be called.
Type the domain name (example.org) in Bucket name, select the Region which you want, create new settings for this bucket or select existing Bucket and click Next
Select and fill the details and then click Next
Uncheck the Block Public Access to Buckets Files, because we need to access our Website from anywhere
Check the bucket details and Click the CreateBucket.
Here, we can see the Bucket and Upload the websites Files into the Bucket by Clicking the Upload
After uploading the files, select all files and Click Actions and select Make Public, to access all our Website files through index.html. (If we give public access only for index.html means images and animations will not work)
Click Make Public
Click Bucket Properties
Click Static Website Hosting
Click the Use this bucket to host a website
Enter index.html in the index document field and error.html in Error Document field. Click Save.
We can see Bucket Hosting has been enabled and ready in Properties tab
Select Route 53 from AWS Management Console, under the services
Click Hosted Zones in Route 53 Dashboard.
Click your Domain
We can see the Domain Dashboard
Create an Alias Record set to route our website with S3 bucket.
Click Yes button to Alias in the Right side Record set creation Tab. Now, we need to set Alias Target for Domain Routing.
In Alias Target Field, we can see our S3 Bucket example.org (S3-website) name. Click it.
Click Create, to create our Alias record set.
Now, our A record Alias has been created.
Then, what is next!! Checkout our browser example.org, its now working.
Summary
Finally, we have created one Bucket and made a static website, with our domain name and added the S3 Bucket for public routing in Route53.
Thank you for reading this article. If you like this please like and share.