skip to Main Content

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?

3

Answers


  1. Your Route53 DNS records value starts with s3-website-... – it looks like you omitted the unique prefix of the S3 website URL.

    Login or Signup to reply.
  2. Let’s assume:

    • Your domain name (hostzone name) in route53 is example.com
    • Your bucket name is test.example.com
    • Your bucket is publicly accessible
    • You’ve enabled static website hosting and the endpoint is http://test.example.com.s3-website.ap-south-1.amazonaws.com

    Ensure below things:

    • The record name should match the bucket name, if your bucket name is test.example.com, your subdomain should be test, if your bucket name is example.com, leave the subdomain empty.
    • The region under Route traffic to should match the region in your static site endpoint.
    • Then if you’ve enabled static website hosting, you’ll get a suggestion under S3 Endpoint as s3-website.ap-south-1.amazonaws.com (test.example.com), and value s3-website.ap-south-1.amazonaws.com will be set if you choose that option.

    By following the above steps, you can resolve this issue.

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search