-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yaml
64 lines (60 loc) · 1.54 KB
/
serverless.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
service: serverless-coginito
plugins:
- serverless-pseudo-parameters
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: ap-northeast-1
functions:
index:
handler: index.handler
events:
- http:
path: demo/index
method: get
authorizer:
arn: "arn:aws:cognito-idp:${self:provider.region}:#{AWS::AccountId}:userpool/#{UserPool}"
cors: true
resources:
Resources:
UserPool:
Type: "AWS::Cognito::UserPool"
Properties:
Schema:
- Name: "email"
StringAttributeConstraints:
MinLength: "0"
MaxLength: "2048"
Required: true
AttributeDataType: "String"
Mutable: true
AliasAttributes: ["email"]
AutoVerifiedAttributes: ["email"]
EmailVerificationSubject: "Your verification code"
EmailVerificationMessage: "Your confirmation 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:
Ref: AWS::StackName
GenerateSecret: false
UserPoolId:
Ref: UserPool
Outputs:
UserPoolId:
Value:
Ref: UserPool
UserPoolClientId:
Value:
Ref: UserPoolClient