Search code examples
amazon-web-servicesamazon-s3amazon-route53

How to correctly deploy an S3 static website using GoogleDomains and R53


I cannot succesfully deploy my static website from S3.

I've followed AWS Guides, YouTube videos but nothing seems to work. Here's my setup:

S3 buckets with names equal to my domain and (www.) subdomain. enter image description here enter image description here enter image description here If I try to go into the S3 website I can see my page: enter image description here www. subdomain bucket as redirect request as http: enter image description here

My hosted zone with properly created records (I believe) enter image description here Then changed my custom domains from domains.google.com to fit the ones in the NS record from the Hosted Zone:

enter image description here

But when I try to go into my domain I get a TimeOut error... enter image description here

Tutorials that I've followed:

If I try to edit the A records with my complete S3 website URL, this is what I see: enter image description here

If I try to input it manually I get an error message: enter image description here

Did I miss something?


Solution

  • The usual option is to combine S3 and Cloudfront, so that you get best global performance and also well named HTTPS URLs. This will also sort out permissions for you. It involves these steps:

    • Upload static content to S3
    • Create a Cloufront distribution that maps to the content
    • Cloudfront distributes content globally and gives you a generated HTTPS URL
    • Route 53 emables you to expose the Cloudfront URL with a custom domain name
    • Use Cloudfront lambdas to fine tune behaviour, such as serving index.html for all paths

    For a walkthrough and further details, see my blog posts. There is a code sample there also, which might provide some useful hints. My scenario is a secured SPA though, so some of it may not be relevant to you.