CNAMEAlreadyExistsException when trying to add an alternate domain name to a cloudfront distribution

amazon-cloudfront

I have a cloudfront distribution (d123.cloudfront.com), which I am trying to add a cname for (static.dev.mysite.com). I have added a CNAME and TXT DNS entry as recommended on this AWS support page https://aws.amazon.com/premiumsupport/knowledge-center/resolve-cnamealreadyexists-error/

$ dig +short static.dev.mysite.com TXT
"d123.cloudfront.net"

$ dig +short static.dev.mysite.com CNAME
d123.cloudfront.net.

But when I go to add it in the AWS console by editing my distribution and filling the "Alternate Domain Names (CNAMEs)" field I get the following error

com.amazonaws.services.cloudfront.model.CNAMEAlreadyExistsException: 
One or more of the CNAMEs you provided are already associated with a different resource. 
(Service: AmazonCloudFront; Status Code: 409; Error Code: CNAMEAlreadyExists; 
Request ID: 02cac56a-4de6-11e8-b008-0fd430b1b7c4)

This domain is not used anywhere else in AWS at the moment.

Best Answer

Excerpt from the AWS support page you are referring:

After the record is created, contact AWS Support and ask that AWS verify the ownership of the DNS domain name to be sure that you can add the CNAME alias to your distribution. Be sure that you provide a copy of the CNAMEAlreadyExists error message in your case with AWS Support.