-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(cognito): CDK generated 'clientName' failed to satisfy constraint: Member must have length less than or equal to 128 #28638
Comments
Yes we probably should fix it with |
Also seeing this on other constructs like |
@BwL1289 Would you be willing to share the CloudFormation template that is generated in this case? Or at least the snippet that contains the User Pool Client? @pahud If |
@kylelaker unfortunately I don't have the template any longer. I can try to reproduce when I have time. |
Looking at the source code. I didn't see CDK is generating any clientName if undefined.
aws-cdk/packages/aws-cdk-lib/aws-cognito/lib/user-pool-client.ts Lines 428 to 437 in 5a68f59
And I just tested it with the CDK in TS as below, it deploys with no error. const client = new cognito.UserPoolClient(
this,
"CognitoUserPoolClient", {
userPool: new cognito.UserPool(this, 'DummyPool'),
generateSecret: true,
enableTokenRevocation: true,
}); @BwL1289 Are you able to simplify your provided snippets by specifying |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
When deploying a stack with a Cognito
UserPoolClient
and not specifying aclientName
(letting Cfn generate aclientName
automatically) I get the following error:Here's the code:
Expected Behavior
A
clientName
with less than 128 characters should be automatically generated.Current Behavior
A
clientName
with more than 128 characters was automatically generated.Reproduction Steps
Create a new
Cognito
UserPoolClient
.Possible Solution
No response
Additional Information/Context
In the same stack I'm generating another
UserPoolClient
but not generating a client secret without specifying a client name and don't run into this error. Unclear if that is related.CDK CLI Version
2.117.0
Framework Version
2.117.0
Node.js Version
18
OS
Linux
Language
Python
Language Version
Python3.9
Other information
Looking into it further, it looks like because this construct is rather nested (constructs in constructs in constructs, etc), the id is over 128 characters so the name being generated is over the 128 character limit.
Expected behavior is that no matter how long the Id is, the generated
clientName
should be truncated to <=128 characters.The text was updated successfully, but these errors were encountered: