aws-solutions / cognito-user-profiles-export-reference-architecture

A reference architecture for exporting user profiles, group details, and group memberships from an Amazon Cognito User Pool to an Amazon DynamoDB global table using AWS Step Functions and AWS Lambda.
https://aws.amazon.com/solutions/implementations/cognito-user-profiles-export-reference-architecture/
Apache License 2.0
53 stars 19 forks source link

Error during NotificationTopic creation due to Topic's displayName exceeding 100 chars. #7

Closed Gireeshjobz closed 3 years ago

Gireeshjobz commented 3 years ago

This solution is setting a very long name for the displayName attribute of SNS CreateTopic request. The displayName has a constraint - 100 max char length.

TopicName: !Sub "cognito-user-profiles-export-reference-architecture-${AWS::Region}-${StackSetConstantsCustomResource.SolutionInstanceUUID}"

Error: "Summaries": "Status": "FAILED", "StatusReason": "ResourceLogicalId:NotificationTopic, ResourceType:AWS::SNS::Topic, ResourceStatusReason:Invalid parameter: Attributes Reason: DisplayName (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: fd64f631-1460-5c61-bdf8-ae4548db41f7; Proxy: null).

Is it possible to cut down on the topic name hardcoded string ?

ericquinones commented 3 years ago

Hi @Gireeshjobz - Thanks for reporting this. We will look into shortening the topic names for the next release.

Do you mind sharing how you deployed the solution (i.e. using the AWS CLI or CloudFormation consonle) and what regions you used as primary and secondary?

I deployed using ap-northeast-1 / ap-southeast-1 as primary / secondary and while I do see that the resulting topic names are long & above 100 characters, I didn't get an error during deployment.

Gireeshjobz commented 3 years ago

Hi @ericquinones -

Context: The solution has https://github.com/awslabs/cognito-user-profiles-export-reference-architecture/blob/master/deployment/stack-set-template.yaml#L1176 DisplayName: !Sub "Cognito User Profiles Export Reference Architecture: ${AWS::Region} (${StackSetConstantsCustomResource.ParentStackName})"`

Our ParentStackName is PBCentralUserManagementInfrastructure. After concatenation, the total length for displayName is exceeding 100 max cap.

Do you mind sharing how you deployed the solution (i.e. using the AWS CLI or CloudFormation consonle) and what regions you used as primary and secondary?

I deployed in us-west-2 (as primary) and us-west-1 (as secondary) regions using AWS Cloudformation template + (sam package/deploy)

I deployed using ap-northeast-1 / ap-southeast-1 as primary / secondary and while I do see that the resulting topic names are long & above 100 characters, I didn't get an error during deployment.

The property that its failing on is DisplayName (max 100 chars). The Topic Name can be max 256 chars. Below is the screenshot of createTopic console. Screen Shot 2021-01-11 at 10 52 09 AM

tomnight commented 3 years ago

Fixed in version 1.0.1