Skip to content

Instantly share code, notes, and snippets.

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 kevinchisholm/8892cdef8c996ae10cd1afd4003c1fb0 to your computer and use it in GitHub Desktop.
Save kevinchisholm/8892cdef8c996ae10cd1afd4003c1fb0 to your computer and use it in GitHub Desktop.
service: my-user-pool
provider:
name: aws
stage: ${opt:stage, "dev"}
custom:
COGNITO_USER_POOL: ${self:service.name}-${self:provider.stage}
COGNITO_CLIENT: ${self:service.name}-cognito-client-${self:provider.stage}
resources:
Resources:
CognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: ${self:custom.COGNITO_USER_POOL}
AutoVerifiedAttributes:
- email
CognitoUserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
ClientName: ${self:custom.COGNITO_CLIENT}
UserPoolId:
Ref: CognitoUserPool
# create groups
CognitoUserPoolGroupAdmins:
Type: AWS::Cognito::UserPoolGroup
Properties:
Description: "Site admins"
GroupName: "admins"
UserPoolId:
Ref: CognitoUserPool
CognitoUserPoolGroupEditors:
Type: AWS::Cognito::UserPoolGroup
Properties:
Description: "Site editors"
GroupName: "editors"
UserPoolId:
Ref: CognitoUserPool
CognitoUserPoolGroupAuthors:
Type: AWS::Cognito::UserPoolGroup
Properties:
Description: "Site authors"
GroupName: "authors"
UserPoolId:
Ref: CognitoUserPool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment