Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use domain registered on Google Domains to point to Amazon S3 Static Website

I've set up many static sites on AWS/S3 with other domain registrars; however, google domains is giving me some issues. Steps I've taken:

On S3/AWS:

  1. created bucket domainname.org
  2. enabled static website hosting by adding index.html
  3. uploaded index.html and related documents to bucket
  4. create bucket www.domainname.org to redirect to bucket domainname.org created bucket policy for domainname.org as follows:

    { "Version": "2012-10-17", "Statement": [ { "Sid": "AddPerm", "Effect": "Allow", "Principal": "", "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::domainname.org/" ] } ] }

On google domains side

  1. Created CNAME record with name www and data entry equal to the bucket's endpoint "bucketname.com.s3-website-us-west-2.amazonaws.com"
  2. Set TTL to 60 so I can see changes.
  3. I can see the site at that endpoint but it is not redirecting/mapping to the domainmae.org as expected. Usually, this set-up would be enough with other registrars

What am I missing? How do you properly set up static site hosting on S3/AWS while using google domains ?

Thank you for your help !

like image 712
Ron M Avatar asked Jul 11 '17 20:07

Ron M


1 Answers

On the Google side, configure the CNAME record (www) to point to s3.amazonaws.com. (yes, the dot included) ... like this:

enter image description here

... and wait a few minutes.

Make sure your S3 bucket is named: www.yourdomain.com

like image 61
Jorge Garcia Avatar answered Oct 24 '22 09:10

Jorge Garcia