-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcognito.config.ts
61 lines (60 loc) · 1.66 KB
/
cognito.config.ts
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
import { AWS } from '@serverless/typescript';
export const cognitoConfig: AWS['resources']['Resources'] = {
AppUserPool: {
Type: 'AWS::Cognito::UserPool',
Properties: {
UserPoolName: '${self:custom.cognitoUserPoolName}',
UsernameAttributes: ['email'],
AutoVerifiedAttributes: ['email'],
Policies: {
PasswordPolicy: {
MinimumLength: 8,
RequireLowercase: true,
RequireNumbers: true,
RequireSymbols: false,
RequireUppercase: true,
},
},
Schema: [
{
Name: 'email',
AttributeDataType: 'String',
Mutable: true,
Required: true,
},
],
LambdaConfig: {
PostConfirmation: {
'Fn::GetAtt': ['OnSignUpLambdaFunction', 'Arn'],
},
},
},
},
// AppIdentityPool: {
// Type: 'AWS::Cognito::IdentityPool',
// Properties: {
// IdentityPoolName: '${self:custom.cognitoIdentityPoolName}',
// CognitoIdentityProviders: [
// {
// ClientId: { 'Fn::GetAtt': ['AppUserPoolClient', 'ClientID'] },
// ProviderName: {
// 'Fn::Sub':
// 'cognito-idp.${self:provider.region}.amazonaws.com/${self:custom.cognitoUserPoolName}',
// },
// },
// ],
// },
// },
AppUserPoolClient: {
Type: 'AWS::Cognito::UserPoolClient',
Properties: {
ClientName: '${self:service}-${self:provider.stage}-user-pool-client',
UserPoolId: { Ref: 'AppUserPool' },
ExplicitAuthFlows: [
'ALLOW_USER_PASSWORD_AUTH',
'ALLOW_REFRESH_TOKEN_AUTH',
],
GenerateSecret: false,
},
},
};