- Newest
- Most votes
- Most comments
This is a common issue when trying to associate a domain with AWS Amplify, especially if the domain was previously used with another AWS service or Amplify app.
The error occurs because each custom domain name must be unique across all CloudFront distributions globally, not just within your account. When you create an Amplify app with a custom domain, it automatically creates an internal CloudFront distribution. Even though you've deleted previous apps and cleared DNS records, the association might still exist in AWS's systems.
Here are some steps to resolve this issue:
- Check for conflicting CloudFront distributions using the AWS CLI:
aws cloudfront list-conflicting-aliases --distribution-id <your-new-distribution-id> --alias <your-domain>
This will show if there's a conflicting distribution and in which account it exists.
-
Wait longer: Sometimes these issues resolve themselves after 24-48 hours as AWS systems update. In some cases, it might take up to 6 hours for the system to fully clear previous associations.
-
Try alternative domain management: You could try using AWS Certificate Manager (ACM) to manage your SSL certificates separately and then link them to your Amplify app.
-
Check other Amplify apps: Ensure no inactive Amplify apps are still holding your domain.
-
Contact AWS Support: If none of the above works after waiting for at least 6 hours, you'll need to contact AWS Support to help clear any hidden associations with your domain name. You can do this through the "Account and billing" support channel, which is free.
The issue is likely that your domain is still associated with a CloudFront distribution in AWS's internal systems, even though it's not visible in your CloudFront console. AWS Support can help release the domain from any lingering associations.
Sources
Unable to associate domain gifted-project.net with Amplify - CNAME already in use | AWS re:Post
Can't Activate AWS Amplify Custom Domain | AWS re:Post
Issues adding a custom domain to my Amplify application | AWS re:Post
