Adding an alternate domain name fails: `CNAMEAlreadyExists: One or more of the CNAMEs you provided are already associated with a different resource.`
IntermediateTroubleshootingRoute 53, CloudFront, API Gateway and Messaging
Answer
Likely causes → Another distribution, possibly in another account (an old environment or a vendor), already has that alternate domain name.
Diagnose →
aws cloudfront list-conflicting-aliases --distribution-id E123ABC --alias www.example.com
aws cloudfront list-distributions --query "DistributionList.Items[?contains(Aliases.Items,'www.example.com')].Id"
Fix →
- Same account: remove the alias from the old distribution, then add it to the new one
- Different account: prove ownership with a TXT record (
_www.example.compointing to the new distribution's domain) and runaws cloudfront associate-alias --target-distribution-id E123ABC --alias www.example.com
Prevent → Track aliases in IaC, and remove them when you decommission distributions.
More on Route 53, CloudFront, API Gateway and Messaging
You created a public hosted zone and records for `example.com`, but `dig example.com` returns `NXDOMAIN` or old records.Beginner`InvalidChangeBatch: RRSet of type CNAME with DNS name example.com. is not permitted at apex in zone example.com.`BeginnerThe primary Region is down, but Route 53 failover records still send traffic to it.IntermediateA Route 53 health check reports `Failure: Connection timed out` for an endpoint that works fine from your laptop.IntermediateYou changed an A record an hour ago, but some users still reach the old server, and a newly created name returned `NXDOMAIN` for a while.AdvancedCloudFront returns `403 AccessDenied` (S3 XML) for every object after you switched the S3 origin to Origin Access Control.Intermediate