Unable to create a custom domain in AWS Cognito

0

Hi,

I have completed my user pool configuration in the AWS Cognito and I got cognito URL like the below which I'm trying to replace with a custom domain:-

https://XXXXXXXX.auth.ap-southeast-1.amazoncognito.com

But getting an error:- Enter image description here

`[InvalidParameterException] Failed to create custom domain "oauth.XXXXXXXXX.com".

requestId: 22309494-1b97-456a-baea-f77ae29470f1 time: Sat Aug 12 2023 21:03:01 GMT+0530 (India Standard Time) code: InvalidParameterException message: Custom domain is not a valid subdomain: Was not able to resolve the root domain, please ensure an A record exists for the root domain.`

I have a public hosted zone like example.com that has got NS records of subdomain, **oauth.example.com **(created as a separate hosted zone). Now, I'm not sure which A record inside example.com I should point to. Also, does Cognito creates any CloudFront distribution endpoint by itself when we set up Cognito? I do not see any distribution endpoint that I should point this A record to?

3개 답변
0
수락된 답변

I solved this issue by giving a fake IP address to A record in the parent domain to get my domain validation successful by Cognito. I then created the custom domain, deleted this A record, and point my sub-domain to the CloudFront endpoint to make this whole setup work

답변함 9달 전
profile picture
전문가
검토됨 2달 전
0

From the error message provided, it looks like the root domain (XXXXXXXX.com) doesn't exist. Do you have an A record for that domain?

profile pictureAWS
전문가
답변함 9달 전
profile picture
전문가
검토됨 9달 전
  • I have public hosted zone like example.com that has got NS records of subdomain, oauth.example.com (created as a separate hosted zone). Now, I'm not sure which A record we are referring to here? My follow-up query is which services or IP address does this A record (inside example.com) should point to?

0

This error occurs when the custom domain is not a valid subdomain or when the root domain does not have an A record. An A record is a type of DNS record that maps a domain name to an IP address. You need to create an A record for your root domain and point it to the CloudFront distribution that Cognito provides for your custom domain. You can use Route 53 or another DNS service to do this.

AWS Cognito using a custom domain need A record (https://stackoverflow.com/questions/61636736/aws-cognito-using-a-custom-domain-need-a-record) custom domain is not a valid subdomain, dependson #11 (https://github.com/fun-stack/terraform-aws-fun/issues/11) Troubleshoot custom domain errors in Amazon Cognito (Troubleshoot custom domain errors in Amazon Cognito)

I hope this helps you resolve your issue.

답변함 9달 전
  • Sorry, I did not understand this statement at all "You need to create an A record for your root domain and point it to the CloudFront distribution that Cognito provides for your custom domain." When I visit the CloudFront service in the Singapore region, I do not see any distribution that got created by Cognito. Do I need to create the distribution by myself? Also, if I go to the public hosted zone of my domain example.com, I do not see any distribution end point while creating A record with alias target to it?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인