Setup custom AWS CloudFront CNAME

Part of: Hosting assets on S3 + Cloudfront

AWS CloudFront distributions provide a random subdomain (e.g., which comes with an SSL certificate.
If we want to use a custom domain name, we have to also setup an SSL certificate.

Here's the summary to save the trips to the various guides scattered around AWS docs.

Assuming we want to point an AWS CloudFront to use

  1. On AWS Certificate Manager (ACM)
    • Create a new public certificate
    • NB: The region must be US-East N. Virginia!
    • You can also get it from somewhere else and import it
  2. On the DNS provider:
    • Add verification CNAME
    • Add CNAME and pointing from domain to distribution domain, e.g. ->
  3. Ensure it all works:
> dig
# ....	13104	IN	CNAME
# 54 IN	A
# ....
  1. On AWS CloudFront
    • Find the distribution
    • Settings -> Edit
    • Set up the CNAME from the previous step, i.e.
    • Set up the certificate created above
  2. Done 🍰