When setting up a user pool in AWS/Cognito using CDK, how can I specify the string length for standard attributes?
I've been trying to figure this out but haven't had any luck so far. I'm working with Typescript.
This is how my user pool is set up:
const userPool = new cognito.UserPool(this, `name-of-user-pool-${stage}`, {
signInAliases: {
email: true,
username: false,
},
standardAttributes: {
fullname: { required: true, mutable: true }, // This is where I want to set the string length
},
passwordPolicy: {
minLength: 8,
requireDigits: true,
requireLowercase: true,
requireUppercase: true,
requireSymbols: true,
},
selfSignUpEnabled: true,
userVerification: {
emailSubject: 'Verify your email !',
emailBody: 'Thank you for signing up to our app! Your verification code is {####}',
emailStyle: cognito.VerificationEmailStyle.CODE,
},
accountRecovery: cognito.AccountRecovery.EMAIL_ONLY,
});