I am trying to describe a new CognitoUserPool in YAML and deploy it with Serverless. I cannot resolve this error on deploy:
An error occurred: CognitoUserPool - Invalid AttributeDataType input, consider using the provided AttributeDataType enum.
The problem is with the custom field I’m trying to specify - “slug”.
AWS docs specify that my type options here are: “Member must satisfy enum value set: [Boolean, Number, String, DateTime]”
I can’t figure out what I’m doing wrong - help!
Here is my YAML file:
Resources:
CognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
# Generate a name based on the stage
UserPoolName: user-pool-${self:custom.stage}
# Set email as an alias
UsernameAttributes:
- email
AutoVerifiedAttributes:
- email
Policies:
PasswordPolicy:
MinimumLength: 8
Schema:
- Name: email
Required: true
Mutable: true
- Name: slug
Required: true
Mutable: true
AttributeDataType: String
StringAttributeConstraints:
MinLength: 6
MaxLength: 256