- Newest
- Most votes
- Most comments
The issue you're experiencing is a common one when dealing with custom domains in AWS services, particularly after deleting and recreating applications. The error message "One or more of the CNAMEs you provided are already associated with a different resource" typically occurs when the domain name you're trying to use is already associated with another CloudFront distribution, even if you can't see it in your account.
Here's what might be happening and some steps to resolve it:
-
When you create an Amplify app, it automatically creates an internal CloudFront distribution. Even though you deleted the app, this association might still exist in AWS's systems.
-
The CNAME (your custom domain) could be linked to a CloudFront distribution in a different AWS account. This can happen if you've used the domain with other AWS services before.
-
There might be a delay in AWS's systems fully removing the previous associations after you deleted the app.
To address this issue:
- Use the AWS CLI to check for conflicting aliases. Run the command: aws cloudfront list-conflicting-aliases --distribution-id <your-new-distribution-id> --alias <your-custom-domain>
This will show you if there's a conflicting distribution and in which account it exists.
-
If the conflicting distribution is in your account but you can't see it, there might be a hidden Amplify-created distribution. Try disabling and then re-enabling the custom domain in your Amplify app settings.
-
If the conflict is with a distribution in a different AWS account that you don't control, you'll need to contact AWS Support. You can do this through the "Account and billing" support channel, which is free. However, they might not be able to fully resolve the issue, in which case you may need to consider paid support.
-
Wait for some time (a few hours to a day) and try again, as sometimes these issues resolve themselves as AWS systems update.
-
If none of the above works, you might need to use a different subdomain temporarily until the issue with the main domain is resolved.
Remember, each custom domain name must be unique across all CloudFront distributions globally, not just within your account. This is why you can encounter this issue even when you don't see any distributions in your own CloudFront console.
If the problem persists, reaching out to AWS Support might be your best option to get the domain fully cleared and ready for use with your new Amplify app.
Sources
"One or more of the CNAMEs you provided are already associated with a different resource." issue when I add my CNAME's to my cloudfront distribution. | AWS re:Post
One or more of the CNAMEs you provided are already associated with a different resource | AWS re:Post
One or more of the CNAMEs you provided are already associated with a different resource | AWS re:Post
One or more of the CNAMEs you provided are already associated with a different resource | AWS re:Post
Hi linus
To fix your domain issue on Amplify:
- Check Route 53: Remove any existing CNAME records for your domain.
- Verify CloudFront: Use AWS CLI to ensure there are no hidden CloudFront distributions with your domain:
aws cloudfront list-distributions
- Release Domain in Amplify: Ensure no inactive Amplify apps are holding your domain.
- Re-add Domain: Try re-adding the domain to your Amplify app.
- Contact AWS Support if the problem persists for help with any hidden associations.
Relevant content
asked 6 years ago
asked 3 years ago
asked 3 years ago
asked 3 years ago
- AWS OFFICIALUpdated 5 years ago
