@aws-solutions-constructs/aws-eventbridge-lambda 1.117.0 → 1.121.0
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.
- package/.jsii +90 -17
- package/README.md +4 -1
- package/lib/index.d.ts +13 -0
- package/lib/index.js +9 -3
- package/package.json +12 -12
- package/test/eventbridge-lambda.test.js +69 -7
- package/test/integ.eventbridge-existing-eventbus.d.ts +13 -0
- package/test/integ.eventbridge-existing-eventbus.expected.json +238 -0
- package/test/integ.eventbridge-existing-eventbus.js +39 -0
- package/test/integ.eventbridge-new-eventbus.d.ts +13 -0
- package/test/integ.eventbridge-new-eventbus.expected.json +238 -0
- package/test/integ.eventbridge-new-eventbus.js +37 -0
- package/test/__snapshots__/eventbridge-lambda.test.js.snap +0 -229
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`snapshot test EventbridgeToLambda default params 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"Parameters": Object {
|
|
6
|
-
"AssetParameters42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198cArtifactHash00A70A91": Object {
|
|
7
|
-
"Description": "Artifact hash for asset \\"42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c\\"",
|
|
8
|
-
"Type": "String",
|
|
9
|
-
},
|
|
10
|
-
"AssetParameters42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198cS3Bucket1F467BCC": Object {
|
|
11
|
-
"Description": "S3 bucket for asset \\"42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c\\"",
|
|
12
|
-
"Type": "String",
|
|
13
|
-
},
|
|
14
|
-
"AssetParameters42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198cS3VersionKey9E4F7872": Object {
|
|
15
|
-
"Description": "S3 key for asset version \\"42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c\\"",
|
|
16
|
-
"Type": "String",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
"Resources": Object {
|
|
20
|
-
"testeventbridgelambdaEventsRule7DB0954D": Object {
|
|
21
|
-
"Properties": Object {
|
|
22
|
-
"ScheduleExpression": "rate(5 minutes)",
|
|
23
|
-
"State": "ENABLED",
|
|
24
|
-
"Targets": Array [
|
|
25
|
-
Object {
|
|
26
|
-
"Arn": Object {
|
|
27
|
-
"Fn::GetAtt": Array [
|
|
28
|
-
"testeventbridgelambdaLambdaFunction475423FD",
|
|
29
|
-
"Arn",
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
"Id": "Target0",
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
"Type": "AWS::Events::Rule",
|
|
37
|
-
},
|
|
38
|
-
"testeventbridgelambdaLambdaFunction475423FD": Object {
|
|
39
|
-
"DependsOn": Array [
|
|
40
|
-
"testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B",
|
|
41
|
-
"testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE",
|
|
42
|
-
],
|
|
43
|
-
"Metadata": Object {
|
|
44
|
-
"cfn_nag": Object {
|
|
45
|
-
"rules_to_suppress": Array [
|
|
46
|
-
Object {
|
|
47
|
-
"id": "W58",
|
|
48
|
-
"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.",
|
|
49
|
-
},
|
|
50
|
-
Object {
|
|
51
|
-
"id": "W89",
|
|
52
|
-
"reason": "This is not a rule for the general case, just for specific use cases/industries",
|
|
53
|
-
},
|
|
54
|
-
Object {
|
|
55
|
-
"id": "W92",
|
|
56
|
-
"reason": "Impossible for us to define the correct concurrency for clients",
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
"Properties": Object {
|
|
62
|
-
"Code": Object {
|
|
63
|
-
"S3Bucket": Object {
|
|
64
|
-
"Ref": "AssetParameters42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198cS3Bucket1F467BCC",
|
|
65
|
-
},
|
|
66
|
-
"S3Key": Object {
|
|
67
|
-
"Fn::Join": Array [
|
|
68
|
-
"",
|
|
69
|
-
Array [
|
|
70
|
-
Object {
|
|
71
|
-
"Fn::Select": Array [
|
|
72
|
-
0,
|
|
73
|
-
Object {
|
|
74
|
-
"Fn::Split": Array [
|
|
75
|
-
"||",
|
|
76
|
-
Object {
|
|
77
|
-
"Ref": "AssetParameters42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198cS3VersionKey9E4F7872",
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
Object {
|
|
84
|
-
"Fn::Select": Array [
|
|
85
|
-
1,
|
|
86
|
-
Object {
|
|
87
|
-
"Fn::Split": Array [
|
|
88
|
-
"||",
|
|
89
|
-
Object {
|
|
90
|
-
"Ref": "AssetParameters42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198cS3VersionKey9E4F7872",
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
"Environment": Object {
|
|
101
|
-
"Variables": Object {
|
|
102
|
-
"AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
"Handler": "index.handler",
|
|
106
|
-
"Role": Object {
|
|
107
|
-
"Fn::GetAtt": Array [
|
|
108
|
-
"testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE",
|
|
109
|
-
"Arn",
|
|
110
|
-
],
|
|
111
|
-
},
|
|
112
|
-
"Runtime": "nodejs12.x",
|
|
113
|
-
"TracingConfig": Object {
|
|
114
|
-
"Mode": "Active",
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
"Type": "AWS::Lambda::Function",
|
|
118
|
-
},
|
|
119
|
-
"testeventbridgelambdaLambdaFunctionAwsEventsLambdaInvokePermission1C8A95062": Object {
|
|
120
|
-
"Properties": Object {
|
|
121
|
-
"Action": "lambda:InvokeFunction",
|
|
122
|
-
"FunctionName": Object {
|
|
123
|
-
"Fn::GetAtt": Array [
|
|
124
|
-
"testeventbridgelambdaLambdaFunction475423FD",
|
|
125
|
-
"Arn",
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
"Principal": "events.amazonaws.com",
|
|
129
|
-
"SourceArn": Object {
|
|
130
|
-
"Fn::GetAtt": Array [
|
|
131
|
-
"testeventbridgelambdaEventsRule7DB0954D",
|
|
132
|
-
"Arn",
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
"Type": "AWS::Lambda::Permission",
|
|
137
|
-
},
|
|
138
|
-
"testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE": Object {
|
|
139
|
-
"Properties": Object {
|
|
140
|
-
"AssumeRolePolicyDocument": Object {
|
|
141
|
-
"Statement": Array [
|
|
142
|
-
Object {
|
|
143
|
-
"Action": "sts:AssumeRole",
|
|
144
|
-
"Effect": "Allow",
|
|
145
|
-
"Principal": Object {
|
|
146
|
-
"Service": "lambda.amazonaws.com",
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
"Version": "2012-10-17",
|
|
151
|
-
},
|
|
152
|
-
"Policies": Array [
|
|
153
|
-
Object {
|
|
154
|
-
"PolicyDocument": Object {
|
|
155
|
-
"Statement": Array [
|
|
156
|
-
Object {
|
|
157
|
-
"Action": Array [
|
|
158
|
-
"logs:CreateLogGroup",
|
|
159
|
-
"logs:CreateLogStream",
|
|
160
|
-
"logs:PutLogEvents",
|
|
161
|
-
],
|
|
162
|
-
"Effect": "Allow",
|
|
163
|
-
"Resource": Object {
|
|
164
|
-
"Fn::Join": Array [
|
|
165
|
-
"",
|
|
166
|
-
Array [
|
|
167
|
-
"arn:",
|
|
168
|
-
Object {
|
|
169
|
-
"Ref": "AWS::Partition",
|
|
170
|
-
},
|
|
171
|
-
":logs:",
|
|
172
|
-
Object {
|
|
173
|
-
"Ref": "AWS::Region",
|
|
174
|
-
},
|
|
175
|
-
":",
|
|
176
|
-
Object {
|
|
177
|
-
"Ref": "AWS::AccountId",
|
|
178
|
-
},
|
|
179
|
-
":log-group:/aws/lambda/*",
|
|
180
|
-
],
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
"Version": "2012-10-17",
|
|
186
|
-
},
|
|
187
|
-
"PolicyName": "LambdaFunctionServiceRolePolicy",
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
"Type": "AWS::IAM::Role",
|
|
192
|
-
},
|
|
193
|
-
"testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B": Object {
|
|
194
|
-
"Metadata": Object {
|
|
195
|
-
"cfn_nag": Object {
|
|
196
|
-
"rules_to_suppress": Array [
|
|
197
|
-
Object {
|
|
198
|
-
"id": "W12",
|
|
199
|
-
"reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC.",
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
"Properties": Object {
|
|
205
|
-
"PolicyDocument": Object {
|
|
206
|
-
"Statement": Array [
|
|
207
|
-
Object {
|
|
208
|
-
"Action": Array [
|
|
209
|
-
"xray:PutTraceSegments",
|
|
210
|
-
"xray:PutTelemetryRecords",
|
|
211
|
-
],
|
|
212
|
-
"Effect": "Allow",
|
|
213
|
-
"Resource": "*",
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
"Version": "2012-10-17",
|
|
217
|
-
},
|
|
218
|
-
"PolicyName": "testeventbridgelambdaLambdaFunctionServiceRoleDefaultPolicyB0C15F1B",
|
|
219
|
-
"Roles": Array [
|
|
220
|
-
Object {
|
|
221
|
-
"Ref": "testeventbridgelambdaLambdaFunctionServiceRole6D02CEEE",
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
},
|
|
225
|
-
"Type": "AWS::IAM::Policy",
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
}
|
|
229
|
-
`;
|