CloudFront CNAME already exists error

0

Hi there!

I'm trying to use my own domain for a CloudFront distribution and keep getting the following error:

One or more of the CNAMEs you provided are already associated with a different resource.

I am 100% sure that I didn't use the same name as a CNAME for another CloudFront distribution in my account.

How can I find out the ARN name of the conflicting distribution? Maybe it was added by another account?

  • By using the following AWS CLI command: aws cloudfront associate-alias --target-distribution-id YourTargeDistributiontID --alias your_cname.example.com

    I found out that the conflicting distribution belongs to another account (not mine).

Aleksei
已提問 1 年前檢視次數 516 次
3 個答案
0
已接受的答案

The issue was resolve by contacting tech support.

Using the following CLI command I discovered that the conflicting CNAME belongs to a separate account I don't own:

aws cloudfront list-conflicting-aliases --distribution-id YourDistributionID --alias YourCNAME

Maybe it was a previous domain owner.

The reply was like:

{
    "ConflictingAliasesList": {
        "MaxItems": 100,
        "Quantity": 1,
        "Items": [
            {
                "Alias": "****",
                "DistributionId": "*******",
                "AccountId": "******"
            }
        ]
    }
}

Then I contacted support and asked to provide me with priority in using my domain's name as CNAME. Then I waited for 4 days and the issue was resolved successfully.

Aleksei
已回答 1 年前
0

If you don't know the distribution ID, use the ListConflictingAliases CloudFront API to find partial information about the distribution and the account ID for the conflicting CNAME alias. Then, use AssociateAlias API to move your CNAME from existing distribution (source distribution) to the new distribution (Target distribution).

Choose one of the following resolutions based on your scenario:

1. If your source and target distributions are in the same account, then complete the steps in the Use the AssociateAlias API to move your CNAME section.
2. If your source and target distributions are in different AWS accounts, then complete the steps in the Deactivate source distribution with the conflicting CNAME section.
3. If your source and target distributions are in different AWS accounts, and the source distribution can't be deactivated because of downtime to existing traffic, then complete the steps in the Use w**ildcard to move the alternate domain name section.

**

For more details check the link below https://aws.amazon.com/premiumsupport/knowledge-center/resolve-cnamealreadyexists-error/

AWS
Pravo
已回答 1 年前
  • Thank you! But all these steps suppose that you can have access and control both distributions. What if the source distribution is not mine?

  • You wont be able to list account if source is not owned by you, you might have to use another cname. You can try the steps Matt has mentioned if it helps.

  • But I did. Of course API call returned the account and distribution ids partially hidden by asterisks. But that was enough to figure out that the account was not mine.

0

Hi There

Are you using any other services like Amplify or an Edge Optimized API Gateway with a custom domain using this same domain name? Those services can create an AWS managed CloudFront distribution on your behalf in a separate AWS managed account which could be causing the conflict.

profile pictureAWS
專家
Matt-B
已回答 1 年前
  • But I already found out that the conflicting CNAME usage belongs to a separate AWS account (not mine).

  • Right, as I mentioned, Those services can create an AWS managed CloudFront distribution on your behalf in a separate AWS managed account (not yours) so you do not have access to it. You would need to delete the Amplify App or Edge Optimized API Gateway (or change them to another domain). Then the CLoudFont distribution thats NOT in your account would get removed automatically.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南