@aws-solutions-constructs/aws-eventbridge-lambda 2.51.0 → 2.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.eslintignore +2 -0
  2. package/.jsii +49 -4
  3. package/integ.config.json +7 -0
  4. package/lib/index.js +1 -1
  5. package/package.json +9 -8
  6. package/test/integ.evtlam-eventbridge-existing-eventbus.js +5 -2
  7. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/asset.42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c/index.js +10 -0
  8. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/cdk.out +1 -0
  9. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/evtlam-eventbridge-existing-eventbus.assets.json +32 -0
  10. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/evtlam-eventbridge-existing-eventbus.template.json +226 -0
  11. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/evtlameventbridgeexistingeventbusIntegDefaultTestDeployAssertF331E474.assets.json +19 -0
  12. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/evtlameventbridgeexistingeventbusIntegDefaultTestDeployAssertF331E474.template.json +36 -0
  13. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/integ.json +12 -0
  14. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/manifest.json +143 -0
  15. package/test/integ.evtlam-eventbridge-existing-eventbus.js.snapshot/tree.json +399 -0
  16. package/test/integ.evtlam-eventbridge-new-eventbus.js +5 -2
  17. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/asset.42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c/index.js +10 -0
  18. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/cdk.out +1 -0
  19. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/evtlam-eventbridge-new-eventbus.assets.json +32 -0
  20. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/evtlam-eventbridge-new-eventbus.template.json +226 -0
  21. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/evtlameventbridgeneweventbusIntegDefaultTestDeployAssert45FE6822.assets.json +19 -0
  22. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/evtlameventbridgeneweventbusIntegDefaultTestDeployAssert45FE6822.template.json +36 -0
  23. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/integ.json +12 -0
  24. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/manifest.json +143 -0
  25. package/test/integ.evtlam-eventbridge-new-eventbus.js.snapshot/tree.json +399 -0
  26. package/test/integ.evtlam-eventbridge-no-argument.js +5 -2
  27. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/asset.42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c/index.js +10 -0
  28. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/cdk.out +1 -0
  29. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/evtlam-eventbridge-no-argument.assets.json +32 -0
  30. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/evtlam-eventbridge-no-argument.template.json +213 -0
  31. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/evtlameventbridgenoargumentIntegDefaultTestDeployAssert5D6CC728.assets.json +19 -0
  32. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/evtlameventbridgenoargumentIntegDefaultTestDeployAssert5D6CC728.template.json +36 -0
  33. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/integ.json +12 -0
  34. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/manifest.json +137 -0
  35. package/test/integ.evtlam-eventbridge-no-argument.js.snapshot/tree.json +368 -0
  36. package/test/integ.evtlam-eventbridge-existing-eventbus.expected.json +0 -226
  37. package/test/integ.evtlam-eventbridge-new-eventbus.expected.json +0 -226
  38. package/test/integ.evtlam-eventbridge-no-argument.expected.json +0 -213
@@ -1,226 +0,0 @@
1
- {
2
- "Resources": {
3
- "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE": {
4
- "Type": "AWS::IAM::Role",
5
- "Properties": {
6
- "AssumeRolePolicyDocument": {
7
- "Statement": [
8
- {
9
- "Action": "sts:AssumeRole",
10
- "Effect": "Allow",
11
- "Principal": {
12
- "Service": "lambda.amazonaws.com"
13
- }
14
- }
15
- ],
16
- "Version": "2012-10-17"
17
- },
18
- "Policies": [
19
- {
20
- "PolicyDocument": {
21
- "Statement": [
22
- {
23
- "Action": [
24
- "logs:CreateLogGroup",
25
- "logs:CreateLogStream",
26
- "logs:PutLogEvents"
27
- ],
28
- "Effect": "Allow",
29
- "Resource": {
30
- "Fn::Join": [
31
- "",
32
- [
33
- "arn:",
34
- {
35
- "Ref": "AWS::Partition"
36
- },
37
- ":logs:",
38
- {
39
- "Ref": "AWS::Region"
40
- },
41
- ":",
42
- {
43
- "Ref": "AWS::AccountId"
44
- },
45
- ":log-group:/aws/lambda/*"
46
- ]
47
- ]
48
- }
49
- }
50
- ],
51
- "Version": "2012-10-17"
52
- },
53
- "PolicyName": "LambdaFunctionServiceRolePolicy"
54
- }
55
- ]
56
- }
57
- },
58
- "testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B": {
59
- "Type": "AWS::IAM::Policy",
60
- "Properties": {
61
- "PolicyDocument": {
62
- "Statement": [
63
- {
64
- "Action": [
65
- "xray:PutTraceSegments",
66
- "xray:PutTelemetryRecords"
67
- ],
68
- "Effect": "Allow",
69
- "Resource": "*"
70
- }
71
- ],
72
- "Version": "2012-10-17"
73
- },
74
- "PolicyName": "testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B",
75
- "Roles": [
76
- {
77
- "Ref": "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE"
78
- }
79
- ]
80
- },
81
- "Metadata": {
82
- "cfn_nag": {
83
- "rules_to_suppress": [
84
- {
85
- "id": "W12",
86
- "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
87
- }
88
- ]
89
- }
90
- }
91
- },
92
- "testeventbridgelambdaLambdaFunction475423FD": {
93
- "Type": "AWS::Lambda::Function",
94
- "Properties": {
95
- "Code": {
96
- "S3Bucket": {
97
- "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
98
- },
99
- "S3Key": "42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c.zip"
100
- },
101
- "Environment": {
102
- "Variables": {
103
- "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1"
104
- }
105
- },
106
- "Handler": "index.handler",
107
- "Role": {
108
- "Fn::GetAtt": [
109
- "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE",
110
- "Arn"
111
- ]
112
- },
113
- "Runtime": "nodejs16.x",
114
- "TracingConfig": {
115
- "Mode": "Active"
116
- }
117
- },
118
- "DependsOn": [
119
- "testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B",
120
- "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE"
121
- ],
122
- "Metadata": {
123
- "cfn_nag": {
124
- "rules_to_suppress": [
125
- {
126
- "id": "W58",
127
- "reason": "Lambda functions has the required permission to write CloudWatch Logs. It uses custom policy instead of arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole with tighter permissions."
128
- },
129
- {
130
- "id": "W89",
131
- "reason": "This is not a rule for the general case, just for specific use cases/industries"
132
- },
133
- {
134
- "id": "W92",
135
- "reason": "Impossible for us to define the correct concurrency for clients"
136
- }
137
- ]
138
- }
139
- }
140
- },
141
- "testeventbridgelambdaLambdaFunctionAwsEventsLambdaInvokePermission1C8A95062": {
142
- "Type": "AWS::Lambda::Permission",
143
- "Properties": {
144
- "Action": "lambda:InvokeFunction",
145
- "FunctionName": {
146
- "Fn::GetAtt": [
147
- "testeventbridgelambdaLambdaFunction475423FD",
148
- "Arn"
149
- ]
150
- },
151
- "Principal": "events.amazonaws.com",
152
- "SourceArn": {
153
- "Fn::GetAtt": [
154
- "testeventbridgelambdaEventsRule7DB0954D",
155
- "Arn"
156
- ]
157
- }
158
- }
159
- },
160
- "testeventbridgelambdatestnewlambdaA726ECBB": {
161
- "Type": "AWS::Events::EventBus",
162
- "Properties": {
163
- "Name": "test-new-lambda"
164
- }
165
- },
166
- "testeventbridgelambdaEventsRule7DB0954D": {
167
- "Type": "AWS::Events::Rule",
168
- "Properties": {
169
- "EventBusName": {
170
- "Ref": "testeventbridgelambdatestnewlambdaA726ECBB"
171
- },
172
- "EventPattern": {
173
- "source": [
174
- "solutionsconstructs"
175
- ]
176
- },
177
- "State": "ENABLED",
178
- "Targets": [
179
- {
180
- "Arn": {
181
- "Fn::GetAtt": [
182
- "testeventbridgelambdaLambdaFunction475423FD",
183
- "Arn"
184
- ]
185
- },
186
- "Id": "Target0"
187
- }
188
- ]
189
- }
190
- }
191
- },
192
- "Parameters": {
193
- "BootstrapVersion": {
194
- "Type": "AWS::SSM::Parameter::Value<String>",
195
- "Default": "/cdk-bootstrap/hnb659fds/version",
196
- "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
197
- }
198
- },
199
- "Rules": {
200
- "CheckBootstrapVersion": {
201
- "Assertions": [
202
- {
203
- "Assert": {
204
- "Fn::Not": [
205
- {
206
- "Fn::Contains": [
207
- [
208
- "1",
209
- "2",
210
- "3",
211
- "4",
212
- "5"
213
- ],
214
- {
215
- "Ref": "BootstrapVersion"
216
- }
217
- ]
218
- }
219
- ]
220
- },
221
- "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
222
- }
223
- ]
224
- }
225
- }
226
- }
@@ -1,213 +0,0 @@
1
- {
2
- "Resources": {
3
- "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE": {
4
- "Type": "AWS::IAM::Role",
5
- "Properties": {
6
- "AssumeRolePolicyDocument": {
7
- "Statement": [
8
- {
9
- "Action": "sts:AssumeRole",
10
- "Effect": "Allow",
11
- "Principal": {
12
- "Service": "lambda.amazonaws.com"
13
- }
14
- }
15
- ],
16
- "Version": "2012-10-17"
17
- },
18
- "Policies": [
19
- {
20
- "PolicyDocument": {
21
- "Statement": [
22
- {
23
- "Action": [
24
- "logs:CreateLogGroup",
25
- "logs:CreateLogStream",
26
- "logs:PutLogEvents"
27
- ],
28
- "Effect": "Allow",
29
- "Resource": {
30
- "Fn::Join": [
31
- "",
32
- [
33
- "arn:",
34
- {
35
- "Ref": "AWS::Partition"
36
- },
37
- ":logs:",
38
- {
39
- "Ref": "AWS::Region"
40
- },
41
- ":",
42
- {
43
- "Ref": "AWS::AccountId"
44
- },
45
- ":log-group:/aws/lambda/*"
46
- ]
47
- ]
48
- }
49
- }
50
- ],
51
- "Version": "2012-10-17"
52
- },
53
- "PolicyName": "LambdaFunctionServiceRolePolicy"
54
- }
55
- ]
56
- }
57
- },
58
- "testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B": {
59
- "Type": "AWS::IAM::Policy",
60
- "Properties": {
61
- "PolicyDocument": {
62
- "Statement": [
63
- {
64
- "Action": [
65
- "xray:PutTraceSegments",
66
- "xray:PutTelemetryRecords"
67
- ],
68
- "Effect": "Allow",
69
- "Resource": "*"
70
- }
71
- ],
72
- "Version": "2012-10-17"
73
- },
74
- "PolicyName": "testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B",
75
- "Roles": [
76
- {
77
- "Ref": "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE"
78
- }
79
- ]
80
- },
81
- "Metadata": {
82
- "cfn_nag": {
83
- "rules_to_suppress": [
84
- {
85
- "id": "W12",
86
- "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
87
- }
88
- ]
89
- }
90
- }
91
- },
92
- "testeventbridgelambdaLambdaFunction475423FD": {
93
- "Type": "AWS::Lambda::Function",
94
- "Properties": {
95
- "Code": {
96
- "S3Bucket": {
97
- "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
98
- },
99
- "S3Key": "42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c.zip"
100
- },
101
- "Environment": {
102
- "Variables": {
103
- "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1"
104
- }
105
- },
106
- "Handler": "index.handler",
107
- "Role": {
108
- "Fn::GetAtt": [
109
- "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE",
110
- "Arn"
111
- ]
112
- },
113
- "Runtime": "nodejs16.x",
114
- "TracingConfig": {
115
- "Mode": "Active"
116
- }
117
- },
118
- "DependsOn": [
119
- "testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B",
120
- "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE"
121
- ],
122
- "Metadata": {
123
- "cfn_nag": {
124
- "rules_to_suppress": [
125
- {
126
- "id": "W58",
127
- "reason": "Lambda functions has the required permission to write CloudWatch Logs. It uses custom policy instead of arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole with tighter permissions."
128
- },
129
- {
130
- "id": "W89",
131
- "reason": "This is not a rule for the general case, just for specific use cases/industries"
132
- },
133
- {
134
- "id": "W92",
135
- "reason": "Impossible for us to define the correct concurrency for clients"
136
- }
137
- ]
138
- }
139
- }
140
- },
141
- "testeventbridgelambdaLambdaFunctionAwsEventsLambdaInvokePermission1C8A95062": {
142
- "Type": "AWS::Lambda::Permission",
143
- "Properties": {
144
- "Action": "lambda:InvokeFunction",
145
- "FunctionName": {
146
- "Fn::GetAtt": [
147
- "testeventbridgelambdaLambdaFunction475423FD",
148
- "Arn"
149
- ]
150
- },
151
- "Principal": "events.amazonaws.com",
152
- "SourceArn": {
153
- "Fn::GetAtt": [
154
- "testeventbridgelambdaEventsRule7DB0954D",
155
- "Arn"
156
- ]
157
- }
158
- }
159
- },
160
- "testeventbridgelambdaEventsRule7DB0954D": {
161
- "Type": "AWS::Events::Rule",
162
- "Properties": {
163
- "ScheduleExpression": "rate(5 minutes)",
164
- "State": "ENABLED",
165
- "Targets": [
166
- {
167
- "Arn": {
168
- "Fn::GetAtt": [
169
- "testeventbridgelambdaLambdaFunction475423FD",
170
- "Arn"
171
- ]
172
- },
173
- "Id": "Target0"
174
- }
175
- ]
176
- }
177
- }
178
- },
179
- "Parameters": {
180
- "BootstrapVersion": {
181
- "Type": "AWS::SSM::Parameter::Value<String>",
182
- "Default": "/cdk-bootstrap/hnb659fds/version",
183
- "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
184
- }
185
- },
186
- "Rules": {
187
- "CheckBootstrapVersion": {
188
- "Assertions": [
189
- {
190
- "Assert": {
191
- "Fn::Not": [
192
- {
193
- "Fn::Contains": [
194
- [
195
- "1",
196
- "2",
197
- "3",
198
- "4",
199
- "5"
200
- ],
201
- {
202
- "Ref": "BootstrapVersion"
203
- }
204
- ]
205
- }
206
- ]
207
- },
208
- "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
209
- }
210
- ]
211
- }
212
- }
213
- }