Mapping a custom domain with website configuration in Amazon S3
First of all, we need a domain name to display our static website that is hosted on Amazon S3. The domain name can be used for any of the domain providers. For our example, we purchased the domain from Route 53 (tweakings3.com). You can take a look at the hosted zone under Route 53 in the AWS Management Console. As we bought the domain from Route 53, it created an entry for the hosted zone as well. Otherwise, we would have needed to manually create the hosted zone and enter the namespace of the DNS provider.
For the static website content, we need to create two buckets: one bucket is for www.tweakings3.com and another for tweakings3.com. This would be helpful if a user tries to open the website by either URL.
We added the index.html
and error.html
pages to both our website buckets. After adding the HTML, don't forget to make it public; this is required for other users to access it. Then, add the bucket policy to access the...