When I try to setup a domain through serverless-domain-manager with sls create_domain
, it fails with:
BadRequestException: The domain name you provided is already associated with an existing CloudFront distribution. Remove the domain name from the existing CloudFront distribution or use a different domain name. If you own this domain name and are not using it on an existing CloudFront distribution, please contact support. api.example.com was not created.
I tracked down the line where the library fails.
Note that my account does not have anything in CloudFront. This is what I see when I open it:
It's also interesting that in Certificate Manager, it says that the certificate is in use:
Under Associated Resources I can see an entry for cloudfront: arn:aws:cloudfront:: ...
Thanx to Matt's guidance I found what caused the phantom CloudFront distros. Within the AWS console, go to:
Amazon API Gateway > Custom Domain Names
Delete all the conflicting domains there and redo the deployment steps again.