AndyHunt.me

CV and personal site of Andy Hunt

AWS CloudFront checks your domain's DNS records for other CloudFront distributions

Posted: Tuesday 06 April 2021 @ 15:15:28

When you add an alternate domain to a CloudFront distribution, the service will look at the DNS records configured for the domain you're adding. If it finds a CNAME record pointing at a different CloudFront distribution, it will return the following error:

One or more aliases specified for the distribution includes an incorrectly configured DNS record that points to another CloudFront distribution. You must update the DNS record to correct the problem. For more information, see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-restrictions

The right way to resolve it is to remove the record before adding the domain, or otherwise replace the record's value with that of the CloudFront distribution you're adding it to.