Point domain to HTTPS static website on S3 / CloudFront

Steps to point your CDN

abc.cloudfront.net to your domain app.xxx.com

Route53
buy domains, you need the hosted zone

AWS Certificate Manager
create certificate (first option on the left) for your domain xxx.com (you can also add all the additional subdomain like app.xxx.com, the one we’ll configure below)
Status should be “issued” (it’s done quickly). Validate by creating DNS records directly from interface.

Cloudfront
Edit zone

  • Alternate Domain Names (CNAMEs): add the custom domain e.g. app.xxx.com
  • Custom SSL Certificate: From the list, you should see the created certificate.
  • Save

Route53

  • Add a simple record
    Name: app.xxx.com
    Type: A
    Routing policy: simple
    Value/Route traffic to: abc.cloudfront.net (Amazon will autofill the value when you specify “Alias to cloudfront distribution”. If you don’t see it, double check you entered a domain covered by the certificate)
  • Add another simple record, same as above but Type: AAAA (IP v6)
  • delete CNAME records used for validation

 

Test

After few seconds you should have it already working, check  app.xxx.com

Links:

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s