[BUG] textract-react Cloudformation Cognito Domain issue
What is the issue?
Cfn template fails with the error below-
Domain already associated with another user pool. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: 85c89a85-6a20-4a39-9064-1cd45f31353a; Proxy: null)
How can someone reproduce this issue (if applicable)?
- Run the
aws cloudformation create-stack ...command
What is the actual result when the preceding steps are followed (if applicable)?
Error in deployment of the Cfn resources.
What was the result you expected instead (if applicable)?
Successful deployment of the Cfn resources.
Environment details to help us try to reproduce the issue (if applicable)
N/a
Any other related details we should know about?
The line here should be parameterized (and as such this must also be parameterized) to take in a custom domain name since Cognito Hosted Domain names must be unique globally (afaik). Also it would be ideal to include the CDK App in this project and let user deploy the entire application using CDK [cdk deploy] instead of Cfn. This would make the creation of the Config.js much easier and less steps to follow to make this sample up and running, using a combination of CfnOutput construct and the --output-file flag of the cdk deploy command.
Also, if user uses --region in the aws cloudformation command to specify a region, and that is not the default region of the AWS CLI setup in one's local machine, the script AddRemoveAssets.js will error with No Cloudformation stack found error since the javascript service clients are initialized with no config ({}) which causes them to use default region. So it would be a good idea to make the script parameterized for the service clients to use ({ region: ${region} }), for example const s3 = new S3Client({region: ${region}}); as well to accept region.
Happy to log a PR for this.