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?

preguntada hace 9 meses922 visualizaciones
3 Respuestas
0
Respuesta aceptada

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

respondido hace 9 meses
profile picture
EXPERTO
revisado hace 2 meses
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
EXPERTO
respondido hace 9 meses
profile picture
EXPERTO
revisado hace 9 meses
  • 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.

respondido hace 9 meses
  • 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?

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas