Search code examples
amazon-web-servicesamazon-cloudfrontamazon-route53aws-certificate-manager

How to apply SSL/TLS certificate applied to cloudfront dist. to a domain on AWS Route 53?


I set up a cloudfront distribution and assigned an SSL certificate to it:

enter image description here

The origin of the cloudfront is pointing here (maybe this is the problem??): enter image description here

The SSL certificate itself is for domains *.populationsimulator.com and www.populationsimulator.com:

enter image description here

When I navigate to the cloudfront dist. URL (https://d2vnsaiy1f228n.cloudfront.net/), things look secure:

enter image description here

I set up the cloudfront dis. URL as an alias in my Route 53 domain: enter image description here

But, when I navigate to the Route 53 URL (http://www.populationsimulator.com/), things don't look secure, but they load quickly enough for me to believe it's now pointing to the cloudfront dist. successfully?: enter image description here

The site can't be reached when I try to include https in the URL (https://www.populationsimulator.com/): enter image description here

Any tips on where I have gone wrong? Many thanks in advance for the help!


Solution

  • There are couple of things you need to fix:

    1.First You need to add www.populationsimulator.com to CloudFront's Alternate Domain's Filed (CNAME)

    2.. In route53, you have record for populationsimulator.com but not for www.populationsimulator.com, once www.populationsimulator.com added to CNAME in CloudFront, you can create an alias record in Route53 for www.populationsimulator.com.

    Once above steps are done, you should be able to access the website using http://www.populationsimulator.com but not with https://populationsimulator.com.

    To make https://populationsimulator.com, you need to get a cert with subject with "populationsimulator.com" and populationsimulator.com into CNAME as well.