Skip to content

Instantly share code, notes, and snippets.

@dhavaln
Created December 29, 2020 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhavaln/282ecdfbec1ac49f778d24b37429b19d to your computer and use it in GitHub Desktop.
Save dhavaln/282ecdfbec1ac49f778d24b37429b19d to your computer and use it in GitHub Desktop.
Amazon Cognito User Pool with Pre and Post triggers
Type: AWS::Cognito::UserPool
Properties:
AccountRecoverySetting:
RecoveryMechanisms:
- Name: 'verified_email'
Priority: 2
AutoVerifiedAttributes:
- email
Policies:
PasswordPolicy:
MinimumLength: 8
RequireLowercase: true
RequireNumbers: true
RequireSymbols: true
RequireUppercase: true
TemporaryPasswordValidityDays: 30
Schema:
- Name: email
Required: true
Mutable: false
UsernameConfiguration:
CaseSensitive: True
LambdaConfig:
PostConfirmation: !GetAtt PostConfirmationHookLambdaFunction.Arn
PreSignUp: !GetAtt PreSignUpHookLambdaFunction.Arn
EmailConfiguration:
EmailSendingAccount: 'COGNITO_DEFAULT'
UserPoolName: ${self:custom.environment.userPoolName}-${opt:stage}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment