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

6,578

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.

Share:
6,578

Related videos on Youtube

jamesj
Author by

jamesj

I am a young professional software developer with experience in Java, C++, Python and C amongst others.

Updated on September 18, 2022

Comments

  • jamesj
    jamesj over 1 year

    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.

    • AlexD
      AlexD almost 6 years
      The page you are referring says that you need to contact AWS support after TXT record created.
    • Michael - sqlbot
      Michael - sqlbot almost 6 years
      @jamesj if your site is static.dev.example.com, an important question is whether you have multiple AWS accounts, and if so, whether one of your other accounts has *.dev.example.com or *.example.com configured in CloudFront. If that is the case, you're hitting a safety check that prevents hijacking wildcards across AWS account boundaries. Confirm?
    • jamesj
      jamesj almost 6 years
      @Michael-sqlbot I think my client has another cloudfront distribution set up in a different account with *.example.com
  • jamesj
    jamesj almost 6 years
    Thanks, now unfortunately I get the message "Technical Support Unavailable under the Basic Support Plan"
  • ceejayoz
    ceejayoz almost 6 years
    @jamesj You can sign up for it for a month, get help, and cancel. Will cost you a couple bucks at most, as it's prorated when you cancel.
  • Sergei
    Sergei about 3 years
    @jamesj You should be able to ask AWS Support for assistance with this issue even without paid support, as long as you can prove to them that you own the domain name you are trying to add to the alternate domain name of your CloudFront distribution. Also here are two very good answers with in-depth explanation to the issue you're facing: - stackoverflow.com/a/41549271/2039449 - stackoverflow.com/a/52788097/2039449