File tree Expand file tree Collapse file tree 5 files changed +278
-0
lines changed Expand file tree Collapse file tree 5 files changed +278
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class CognitoUserPool(Resource):
9
9
"AdminCreateUserConfig" : GeneratedProperty (),
10
10
"AliasAttributes" : GeneratedProperty (),
11
11
"AutoVerifiedAttributes" : GeneratedProperty (),
12
+ "DeletionProtection" : GeneratedProperty (),
12
13
"DeviceConfiguration" : GeneratedProperty (),
13
14
"EmailConfiguration" : GeneratedProperty (),
14
15
"EmailVerificationMessage" : GeneratedProperty (),
Original file line number Diff line number Diff line change
1
+ Transform : AWS::Serverless-2016-10-31
2
+ Resources :
3
+ MyUserPool :
4
+ Type : AWS::Cognito::UserPool
5
+ Properties :
6
+ DeletionProtection : ACTIVE
7
+
8
+ MyFunction :
9
+ Type : AWS::Serverless::Function
10
+ Properties :
11
+ Runtime : python3.8
12
+ InlineCode : foo
13
+ Handler : bar
14
+ Events :
15
+ CognitoEvent :
16
+ Type : Cognito
17
+ Properties :
18
+ Trigger : CustomMessage
19
+ UserPool : !Ref MyUserPool
Original file line number Diff line number Diff line change
1
+ {
2
+ "Resources" : {
3
+ "MyFunction" : {
4
+ "Properties" : {
5
+ "Code" : {
6
+ "ZipFile" : " foo"
7
+ },
8
+ "Handler" : " bar" ,
9
+ "Role" : {
10
+ "Fn::GetAtt" : [
11
+ " MyFunctionRole" ,
12
+ " Arn"
13
+ ]
14
+ },
15
+ "Runtime" : " python3.8" ,
16
+ "Tags" : [
17
+ {
18
+ "Key" : " lambda:createdBy" ,
19
+ "Value" : " SAM"
20
+ }
21
+ ]
22
+ },
23
+ "Type" : " AWS::Lambda::Function"
24
+ },
25
+ "MyFunctionCognitoPermission" : {
26
+ "Properties" : {
27
+ "Action" : " lambda:InvokeFunction" ,
28
+ "FunctionName" : {
29
+ "Ref" : " MyFunction"
30
+ },
31
+ "Principal" : " cognito-idp.amazonaws.com" ,
32
+ "SourceArn" : {
33
+ "Fn::GetAtt" : [
34
+ " MyUserPool" ,
35
+ " Arn"
36
+ ]
37
+ }
38
+ },
39
+ "Type" : " AWS::Lambda::Permission"
40
+ },
41
+ "MyFunctionRole" : {
42
+ "Properties" : {
43
+ "AssumeRolePolicyDocument" : {
44
+ "Statement" : [
45
+ {
46
+ "Action" : [
47
+ " sts:AssumeRole"
48
+ ],
49
+ "Effect" : " Allow" ,
50
+ "Principal" : {
51
+ "Service" : [
52
+ " lambda.amazonaws.com"
53
+ ]
54
+ }
55
+ }
56
+ ],
57
+ "Version" : " 2012-10-17"
58
+ },
59
+ "ManagedPolicyArns" : [
60
+ " arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
61
+ ],
62
+ "Tags" : [
63
+ {
64
+ "Key" : " lambda:createdBy" ,
65
+ "Value" : " SAM"
66
+ }
67
+ ]
68
+ },
69
+ "Type" : " AWS::IAM::Role"
70
+ },
71
+ "MyUserPool" : {
72
+ "Properties" : {
73
+ "DeletionProtection" : " ACTIVE" ,
74
+ "LambdaConfig" : {
75
+ "CustomMessage" : {
76
+ "Fn::GetAtt" : [
77
+ " MyFunction" ,
78
+ " Arn"
79
+ ]
80
+ }
81
+ }
82
+ },
83
+ "Type" : " AWS::Cognito::UserPool"
84
+ }
85
+ }
86
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "Resources" : {
3
+ "MyFunction" : {
4
+ "Properties" : {
5
+ "Code" : {
6
+ "ZipFile" : " foo"
7
+ },
8
+ "Handler" : " bar" ,
9
+ "Role" : {
10
+ "Fn::GetAtt" : [
11
+ " MyFunctionRole" ,
12
+ " Arn"
13
+ ]
14
+ },
15
+ "Runtime" : " python3.8" ,
16
+ "Tags" : [
17
+ {
18
+ "Key" : " lambda:createdBy" ,
19
+ "Value" : " SAM"
20
+ }
21
+ ]
22
+ },
23
+ "Type" : " AWS::Lambda::Function"
24
+ },
25
+ "MyFunctionCognitoPermission" : {
26
+ "Properties" : {
27
+ "Action" : " lambda:InvokeFunction" ,
28
+ "FunctionName" : {
29
+ "Ref" : " MyFunction"
30
+ },
31
+ "Principal" : " cognito-idp.amazonaws.com" ,
32
+ "SourceArn" : {
33
+ "Fn::GetAtt" : [
34
+ " MyUserPool" ,
35
+ " Arn"
36
+ ]
37
+ }
38
+ },
39
+ "Type" : " AWS::Lambda::Permission"
40
+ },
41
+ "MyFunctionRole" : {
42
+ "Properties" : {
43
+ "AssumeRolePolicyDocument" : {
44
+ "Statement" : [
45
+ {
46
+ "Action" : [
47
+ " sts:AssumeRole"
48
+ ],
49
+ "Effect" : " Allow" ,
50
+ "Principal" : {
51
+ "Service" : [
52
+ " lambda.amazonaws.com"
53
+ ]
54
+ }
55
+ }
56
+ ],
57
+ "Version" : " 2012-10-17"
58
+ },
59
+ "ManagedPolicyArns" : [
60
+ " arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
61
+ ],
62
+ "Tags" : [
63
+ {
64
+ "Key" : " lambda:createdBy" ,
65
+ "Value" : " SAM"
66
+ }
67
+ ]
68
+ },
69
+ "Type" : " AWS::IAM::Role"
70
+ },
71
+ "MyUserPool" : {
72
+ "Properties" : {
73
+ "DeletionProtection" : " ACTIVE" ,
74
+ "LambdaConfig" : {
75
+ "CustomMessage" : {
76
+ "Fn::GetAtt" : [
77
+ " MyFunction" ,
78
+ " Arn"
79
+ ]
80
+ }
81
+ }
82
+ },
83
+ "Type" : " AWS::Cognito::UserPool"
84
+ }
85
+ }
86
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "Resources" : {
3
+ "MyFunction" : {
4
+ "Properties" : {
5
+ "Code" : {
6
+ "ZipFile" : " foo"
7
+ },
8
+ "Handler" : " bar" ,
9
+ "Role" : {
10
+ "Fn::GetAtt" : [
11
+ " MyFunctionRole" ,
12
+ " Arn"
13
+ ]
14
+ },
15
+ "Runtime" : " python3.8" ,
16
+ "Tags" : [
17
+ {
18
+ "Key" : " lambda:createdBy" ,
19
+ "Value" : " SAM"
20
+ }
21
+ ]
22
+ },
23
+ "Type" : " AWS::Lambda::Function"
24
+ },
25
+ "MyFunctionCognitoPermission" : {
26
+ "Properties" : {
27
+ "Action" : " lambda:InvokeFunction" ,
28
+ "FunctionName" : {
29
+ "Ref" : " MyFunction"
30
+ },
31
+ "Principal" : " cognito-idp.amazonaws.com" ,
32
+ "SourceArn" : {
33
+ "Fn::GetAtt" : [
34
+ " MyUserPool" ,
35
+ " Arn"
36
+ ]
37
+ }
38
+ },
39
+ "Type" : " AWS::Lambda::Permission"
40
+ },
41
+ "MyFunctionRole" : {
42
+ "Properties" : {
43
+ "AssumeRolePolicyDocument" : {
44
+ "Statement" : [
45
+ {
46
+ "Action" : [
47
+ " sts:AssumeRole"
48
+ ],
49
+ "Effect" : " Allow" ,
50
+ "Principal" : {
51
+ "Service" : [
52
+ " lambda.amazonaws.com"
53
+ ]
54
+ }
55
+ }
56
+ ],
57
+ "Version" : " 2012-10-17"
58
+ },
59
+ "ManagedPolicyArns" : [
60
+ " arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
61
+ ],
62
+ "Tags" : [
63
+ {
64
+ "Key" : " lambda:createdBy" ,
65
+ "Value" : " SAM"
66
+ }
67
+ ]
68
+ },
69
+ "Type" : " AWS::IAM::Role"
70
+ },
71
+ "MyUserPool" : {
72
+ "Properties" : {
73
+ "DeletionProtection" : " ACTIVE" ,
74
+ "LambdaConfig" : {
75
+ "CustomMessage" : {
76
+ "Fn::GetAtt" : [
77
+ " MyFunction" ,
78
+ " Arn"
79
+ ]
80
+ }
81
+ }
82
+ },
83
+ "Type" : " AWS::Cognito::UserPool"
84
+ }
85
+ }
86
+ }
You can’t perform that action at this time.
0 commit comments