I am trying to host a websit with only static pages on BitBucket.com using its Add-On Aerobatic. While registering the domain on Aerobatic, its giving me the following error:
CNAME already registered with CloudFront
AWS is reporting that this domain is already registered with a different CloudFront distribution. In order to complete the registration process, you'll first need to disable that distribution.
I never registered the domain with AWS CloudFront and hence can't figure out what is going on.
Any clue to this problem would be greatly appreciated.
Thanks,
Sourin
This issue can have several possible causes.
CloudFront treats alternate domain names (which they also call "CNAMEs" even though this doesn't imply that actual CNAME records necessarily exist in DNS) as a single global namespace.
No two CloudFront distributions can have the same alternate domain name, whether in the same AWS account or in different accounts.
Additionally, no two CloudFront distributions can have ambiguous alternate domain names, unless they are owned by the same AWS account. An example of ambiguous names would be
*.example.com
andwww.example.com
. This is ambiguous because*.example.com
also matcheswww.example.com
. This configuration is accepted and works correctly, but only if both distributions are in the same account.Additionally, API Gateway edge-optimized APIs use the CloudFront network, so their custom hostnames are part of the globally-unique CloudFront namespace mentioned above, with the additional caveat that ambiguous mappings are not supported when API Gateway edge optimization is used.
Not all of the possible conditions here are directly applicable to the exact circumstances in the question above, but here is a list of some possibilities to consider:
example.com
(your domain) when the intended value should have beenexample.org
(their domain), orIf you're certain that none of the above conditions are applicable in such a way that you can fix this yourself (i.e. it's not already configured in one of your CloudFront distributions in any of your AWS accounts or in API Gateway) then see How do I resolve the error CNAMEAlreadyExists when setting up a CNAME alias for my Amazon CloudFront distribution? in the AWS Support Knowledge Base for the process to get CloudFront to unlock the domain, using a special
TXT
record in DNS, followed by an AWS support request.If you don't have a paid technical support plan, this should also be possible by submitting an account support request, since you are asking them to fix the setup of your account, not fix or troubleshoot your systems or code, etc.