skip to Main Content

Here is the process I followed so maybe I can have some help here:

  1. I registered and paid for a domain on Amazon Route 53

  2. I am trying to host a static website on a S3 bucket so I created a Hosted Zone with the apex domain (example.com) and an alias (www.example.com) pointing to the apex hosted zone and a record type NS and SOA were created by default.

  3. Uploaded my webpage to S3. In properties I can access to this page trough a link http://example.com.s3-website-us-west-1.amazonaws.com, but this does not have SSL / TLS certificates, so the webpage is not accessible without warnings.

  4. To be able to use CloudFront I intended to request public SSL / TLS certificate through the AWS Certificate Manager, for example.com and www.example.com

  5. Now my distribution is active on CloudFront, but the domain is someid.cloudfront.net. I have tried a lot of things and read documentation but its confusing for me to use the domain from Route 53 to redirect it to the CloudFront domain. Any advice?

Tried to remake all the process again but I don’t know what else I need to do. I’m expecting to use the domain I registered on Route 53 to redirect it to the CloudFront distribution.

2

Answers


  1. Use can just use Alternate domain in Cloudfront and add the url where you have to redirect it to, you can refer the below blogs

    https://crishantha.medium.com/hosting-a-secure-aws-cloudfront-endpoint-via-aws-route-53-be65d42191b7

    https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

    Login or Signup to reply.
  2. Follow the below steps to live your site hosted in Cloudfront (S3 as origin) through route53:

    Prerequisites
    Make sure you’ve added example.com and www.example.com as an alias in Cloudfront distribution origin.

    To do so, follow the below steps:

    • Open your distribution
    • Click on General tab
    • Under Settings column
    • Click on edit
    • Add your domain (www.example.com) as alias in Alternate domain name column, (you can add multiple domains here)
    • Choose ACM certificate under Custom SSL certificate (If you don’t have one you can request one in ACM, it’s pretty easy, and you can get it in less than 5 min)

    ACM Certificate Generation Checklist

    • region should be us-east-1
    • You should add all the other subdomains you need to include in this certificate, like *.example.com (to support http://www.example.com) using Add another name to this certificate

    Route 53 Steps

    • Create Record
    • Choose Record Type as A
    • Check the alias option
    • In the Route traffic to field, choose Alias to Cloud front distribution
    • Choose the distribution (someid.cloudfront.net)
    • Save and wait for it to be live.

    This should work.

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