Skip to content

Instantly share code, notes, and snippets.

@t3yamoto
Last active July 13, 2018 05:34
Show Gist options
  • Save t3yamoto/933e110a5d9bdb2fab44c87171015f26 to your computer and use it in GitHub Desktop.
Save t3yamoto/933e110a5d9bdb2fab44c87171015f26 to your computer and use it in GitHub Desktop.
serverless-app-guide5-4
.python-version
#!/bin/sh
STACK_NAME="your-stack-name"
REGION="ap-northeast-1"
aws cloudformation create-stack \
--stack-name ${STACK_NAME} \
--region ${REGION} \
--template-body file://userpool-template.yaml \
#!/bin/sh
STACK_NAME="your-stack-name"
REGION="ap-northeast-1"
aws cloudformation describe-stacks \
--stack-name ${STACK_NAME} \
--region ${REGION} \
Resources:
UserPool:
Type: 'AWS::Cognito::UserPool'
Properties:
Schema:
- Name: 'email'
StringAttributeConstraints:
MinLength: '0'
MaxLength: '2048'
Required: true
AttributeDataType: 'String'
Mutable: true
AdminCreateUserConfig:
AllowAdminCreateUserOnly: true
AliasAttributes: ['email']
AutoVerifiedAttributes: ['email']
EmailVerificationSubject: 'Your verification code'
EmailVerificationMessage: 'Your verification code is {####}.'
MfaConfiguration: 'OFF'
UserPoolName:
Ref: AWS::StackName
Policies:
PasswordPolicy:
RequireLowercase: false
RequireSymbols: false
RequireNumbers: false
MinimumLength: 6
RequireUppercase: false
UserPoolClient:
Type : "AWS::Cognito::UserPoolClient"
Properties:
ClientName: 'client-app-name'
GenerateSecret: false
UserPoolId: !Ref UserPool
Outputs:
UserPoolId:
Value: !Ref UserPool
UserPoolClientId:
Value: !Ref UserPoolClient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment