Skip to content

Instantly share code, notes, and snippets.

@s1moe2
Created February 4, 2022 11:05
Show Gist options
  • Save s1moe2/22ed8b008b2dc5f2c5e67e909793cc7f to your computer and use it in GitHub Desktop.
Save s1moe2/22ed8b008b2dc5f2c5e67e909793cc7f to your computer and use it in GitHub Desktop.
CloudFormation - user pool & client setup sample
AWSTemplateFormatVersion: 2010-09-09
Parameters:
PoolName:
Type: String
PoolClientName:
Type: string
Resources:
Pool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: !Ref PoolName
UsernameAttributes:
- email
UsernameConfiguration:
CaseSensitive: false
Policies:
PasswordPolicy:
MinimumLength: 8
RequireLowercase: true
RequireUppercase: true
RequireNumbers: true
RequireSymbols: true
TemporaryPasswordValidityDays: 7
PoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
ClientName: !Ref PoolClientName
GenerateSecret: false
UserPoolId: !Ref Pool
Outputs:
UserPoolId:
Value: !Ref UserPool
Export:
Name: "Pool::Id"
UserPoolClientId:
Value: !Ref UserPoolClient
Export:
Name: "PoolClient::Id"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment