Point domain to Amazon S3 bucket
I’ve recently registered a domain name (sylviang.me) from Media Temple benefiting from their $1 valentine’s day domain sale. So I decided to “live” this blog that I’ve been working on for the past few days.
Setting up an S3 bucket as a static website is pretty straightforward as referred to the AWS guide. However, as this is the 1st time I am using Amazon S3 and Media Temple DNS, I am not sure how should I configure my DNS. But nothing is not possible with some googling and playing around.
For clarity sake and because I’ll forget if I don’t write it down, I am going over the steps below.
-
Create two buckets. It must be the same name as your domain name. e.g. sylviang.me & www.sylviang.me
-
Upload your content to one of the S3 bucket (sylviang.me).
-
Configure buckets for website hosting. Enable website hosting for bucket (sylviang.me). Redirect all requests to another host name for bucket (www.sylviang.me).
-
Test and make sure the “EndPoint” url works as expected. It should be something like sylviang.me.s3-website-ap-southeast-1.amazonaws.com
-
Using the administration tools provided by your domain registrar, remove any “A” records that may have been automatically setup for your domain.
-
Forward your root domain (sylviang.me) to the www subdomain (www.sylviang.me). Mask the forwarding so visitors will see your registered domain instead of the S3 url.
-
Add a “CNAME” for the www subdomain, pointing to your S3 url (sylviang.me.s3-website-ap-southeast-1.amazonaws.com).
-
Now wait for the changes to propagate!