AWS Cognito User Pool custom domain error
One or more aliases specified for the distribution includes an incorrectly configured DNS record that points to another CloudFront distribution.
I was deleting the user pool, and try to recreating a new one with Terraform, then encounter this error:
Error: creating Cognito User Pool Domain (xxx.example.com): InvalidParameterException: One or more aliases specified
But I don’t see any CloudFront distribution in my AWS console. It took me hours of troubleshooting…
$ dig A xxx.example.com +short
Eventually, I noticed the my domain is still pointing to a CNAME record. I deleted that record, and re-run the terraform command, and it works well.