@aws-solutions-constructs/aws-sqs-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.sqslam-deployFifoQueue.js +5 -2
  7. package/test/integ.sqslam-deployFifoQueue.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  8. package/test/integ.sqslam-deployFifoQueue.js.snapshot/cdk.out +1 -0
  9. package/test/integ.sqslam-deployFifoQueue.js.snapshot/integ.json +12 -0
  10. package/test/integ.sqslam-deployFifoQueue.js.snapshot/manifest.json +155 -0
  11. package/test/integ.sqslam-deployFifoQueue.js.snapshot/sqslam-deployFifoQueue.assets.json +32 -0
  12. package/test/integ.sqslam-deployFifoQueue.js.snapshot/sqslam-deployFifoQueue.template.json +378 -0
  13. package/test/integ.sqslam-deployFifoQueue.js.snapshot/sqslamdeployFifoQueueIntegDefaultTestDeployAssert77FD67F7.assets.json +19 -0
  14. package/test/integ.sqslam-deployFifoQueue.js.snapshot/sqslamdeployFifoQueueIntegDefaultTestDeployAssert77FD67F7.template.json +36 -0
  15. package/test/integ.sqslam-deployFifoQueue.js.snapshot/tree.json +592 -0
  16. package/test/integ.sqslam-deployFunction.js +5 -2
  17. package/test/integ.sqslam-deployFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  18. package/test/integ.sqslam-deployFunction.js.snapshot/cdk.out +1 -0
  19. package/test/integ.sqslam-deployFunction.js.snapshot/integ.json +12 -0
  20. package/test/integ.sqslam-deployFunction.js.snapshot/manifest.json +155 -0
  21. package/test/integ.sqslam-deployFunction.js.snapshot/sqslam-deployFunction.assets.json +32 -0
  22. package/test/integ.sqslam-deployFunction.js.snapshot/sqslam-deployFunction.template.json +374 -0
  23. package/test/integ.sqslam-deployFunction.js.snapshot/sqslamdeployFunctionIntegDefaultTestDeployAssert1ACA7AF2.assets.json +19 -0
  24. package/test/integ.sqslam-deployFunction.js.snapshot/sqslamdeployFunctionIntegDefaultTestDeployAssert1ACA7AF2.template.json +36 -0
  25. package/test/integ.sqslam-deployFunction.js.snapshot/tree.json +588 -0
  26. package/test/integ.sqslam-existingFunction.js +5 -2
  27. package/test/integ.sqslam-existingFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  28. package/test/integ.sqslam-existingFunction.js.snapshot/cdk.out +1 -0
  29. package/test/integ.sqslam-existingFunction.js.snapshot/integ.json +12 -0
  30. package/test/integ.sqslam-existingFunction.js.snapshot/manifest.json +155 -0
  31. package/test/integ.sqslam-existingFunction.js.snapshot/sqslam-existingFunction.assets.json +32 -0
  32. package/test/integ.sqslam-existingFunction.js.snapshot/sqslam-existingFunction.template.json +374 -0
  33. package/test/integ.sqslam-existingFunction.js.snapshot/sqslamexistingFunctionIntegDefaultTestDeployAssert2E8A6942.assets.json +19 -0
  34. package/test/integ.sqslam-existingFunction.js.snapshot/sqslamexistingFunctionIntegDefaultTestDeployAssert2E8A6942.template.json +36 -0
  35. package/test/integ.sqslam-existingFunction.js.snapshot/tree.json +588 -0
  36. package/test/integ.sqslam-deployFifoQueue.expected.json +0 -378
  37. package/test/integ.sqslam-deployFunction.expected.json +0 -374
  38. package/test/integ.sqslam-existingFunction.expected.json +0 -374
@@ -1,374 +0,0 @@
1
- {
2
- "Description": "Integration Test for aws-sqs-lambda",
3
- "Resources": {
4
- "LambdaFunctionServiceRole0C4CDE0B": {
5
- "Type": "AWS::IAM::Role",
6
- "Properties": {
7
- "AssumeRolePolicyDocument": {
8
- "Statement": [
9
- {
10
- "Action": "sts:AssumeRole",
11
- "Effect": "Allow",
12
- "Principal": {
13
- "Service": "lambda.amazonaws.com"
14
- }
15
- }
16
- ],
17
- "Version": "2012-10-17"
18
- },
19
- "Policies": [
20
- {
21
- "PolicyDocument": {
22
- "Statement": [
23
- {
24
- "Action": [
25
- "logs:CreateLogGroup",
26
- "logs:CreateLogStream",
27
- "logs:PutLogEvents"
28
- ],
29
- "Effect": "Allow",
30
- "Resource": {
31
- "Fn::Join": [
32
- "",
33
- [
34
- "arn:",
35
- {
36
- "Ref": "AWS::Partition"
37
- },
38
- ":logs:",
39
- {
40
- "Ref": "AWS::Region"
41
- },
42
- ":",
43
- {
44
- "Ref": "AWS::AccountId"
45
- },
46
- ":log-group:/aws/lambda/*"
47
- ]
48
- ]
49
- }
50
- }
51
- ],
52
- "Version": "2012-10-17"
53
- },
54
- "PolicyName": "LambdaFunctionServiceRolePolicy"
55
- }
56
- ]
57
- }
58
- },
59
- "LambdaFunctionServiceRoleDefaultPolicy126C8897": {
60
- "Type": "AWS::IAM::Policy",
61
- "Properties": {
62
- "PolicyDocument": {
63
- "Statement": [
64
- {
65
- "Action": [
66
- "xray:PutTraceSegments",
67
- "xray:PutTelemetryRecords"
68
- ],
69
- "Effect": "Allow",
70
- "Resource": "*"
71
- },
72
- {
73
- "Action": [
74
- "sqs:ReceiveMessage",
75
- "sqs:ChangeMessageVisibility",
76
- "sqs:GetQueueUrl",
77
- "sqs:DeleteMessage",
78
- "sqs:GetQueueAttributes"
79
- ],
80
- "Effect": "Allow",
81
- "Resource": {
82
- "Fn::GetAtt": [
83
- "testsqslambdaqueue601203B8",
84
- "Arn"
85
- ]
86
- }
87
- }
88
- ],
89
- "Version": "2012-10-17"
90
- },
91
- "PolicyName": "LambdaFunctionServiceRoleDefaultPolicy126C8897",
92
- "Roles": [
93
- {
94
- "Ref": "LambdaFunctionServiceRole0C4CDE0B"
95
- }
96
- ]
97
- },
98
- "Metadata": {
99
- "cfn_nag": {
100
- "rules_to_suppress": [
101
- {
102
- "id": "W12",
103
- "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
104
- }
105
- ]
106
- }
107
- }
108
- },
109
- "LambdaFunctionBF21E41F": {
110
- "Type": "AWS::Lambda::Function",
111
- "Properties": {
112
- "Code": {
113
- "S3Bucket": {
114
- "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
115
- },
116
- "S3Key": "0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f.zip"
117
- },
118
- "Environment": {
119
- "Variables": {
120
- "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1"
121
- }
122
- },
123
- "Handler": "index.handler",
124
- "Role": {
125
- "Fn::GetAtt": [
126
- "LambdaFunctionServiceRole0C4CDE0B",
127
- "Arn"
128
- ]
129
- },
130
- "Runtime": "nodejs16.x",
131
- "TracingConfig": {
132
- "Mode": "Active"
133
- }
134
- },
135
- "DependsOn": [
136
- "LambdaFunctionServiceRoleDefaultPolicy126C8897",
137
- "LambdaFunctionServiceRole0C4CDE0B"
138
- ],
139
- "Metadata": {
140
- "cfn_nag": {
141
- "rules_to_suppress": [
142
- {
143
- "id": "W58",
144
- "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."
145
- },
146
- {
147
- "id": "W89",
148
- "reason": "This is not a rule for the general case, just for specific use cases/industries"
149
- },
150
- {
151
- "id": "W92",
152
- "reason": "Impossible for us to define the correct concurrency for clients"
153
- }
154
- ]
155
- }
156
- }
157
- },
158
- "LambdaFunctionSqsEventSourcesqslamexistingFunctiontestsqslambdaqueue1655244776FD943D": {
159
- "Type": "AWS::Lambda::EventSourceMapping",
160
- "Properties": {
161
- "EventSourceArn": {
162
- "Fn::GetAtt": [
163
- "testsqslambdaqueue601203B8",
164
- "Arn"
165
- ]
166
- },
167
- "FunctionName": {
168
- "Ref": "LambdaFunctionBF21E41F"
169
- }
170
- }
171
- },
172
- "testsqslambdadeadLetterQueue85BDB0A3": {
173
- "Type": "AWS::SQS::Queue",
174
- "Properties": {
175
- "KmsMasterKeyId": "alias/aws/sqs"
176
- },
177
- "UpdateReplacePolicy": "Delete",
178
- "DeletionPolicy": "Delete"
179
- },
180
- "testsqslambdadeadLetterQueuePolicy8C08D1A5": {
181
- "Type": "AWS::SQS::QueuePolicy",
182
- "Properties": {
183
- "PolicyDocument": {
184
- "Statement": [
185
- {
186
- "Action": [
187
- "sqs:DeleteMessage",
188
- "sqs:ReceiveMessage",
189
- "sqs:SendMessage",
190
- "sqs:GetQueueAttributes",
191
- "sqs:RemovePermission",
192
- "sqs:AddPermission",
193
- "sqs:SetQueueAttributes"
194
- ],
195
- "Effect": "Allow",
196
- "Principal": {
197
- "AWS": {
198
- "Fn::Join": [
199
- "",
200
- [
201
- "arn:",
202
- {
203
- "Ref": "AWS::Partition"
204
- },
205
- ":iam::",
206
- {
207
- "Ref": "AWS::AccountId"
208
- },
209
- ":root"
210
- ]
211
- ]
212
- }
213
- },
214
- "Resource": {
215
- "Fn::GetAtt": [
216
- "testsqslambdadeadLetterQueue85BDB0A3",
217
- "Arn"
218
- ]
219
- },
220
- "Sid": "QueueOwnerOnlyAccess"
221
- },
222
- {
223
- "Action": "SQS:*",
224
- "Condition": {
225
- "Bool": {
226
- "aws:SecureTransport": "false"
227
- }
228
- },
229
- "Effect": "Deny",
230
- "Principal": {
231
- "AWS": "*"
232
- },
233
- "Resource": {
234
- "Fn::GetAtt": [
235
- "testsqslambdadeadLetterQueue85BDB0A3",
236
- "Arn"
237
- ]
238
- },
239
- "Sid": "HttpsOnly"
240
- }
241
- ],
242
- "Version": "2012-10-17"
243
- },
244
- "Queues": [
245
- {
246
- "Ref": "testsqslambdadeadLetterQueue85BDB0A3"
247
- }
248
- ]
249
- }
250
- },
251
- "testsqslambdaqueue601203B8": {
252
- "Type": "AWS::SQS::Queue",
253
- "Properties": {
254
- "KmsMasterKeyId": "alias/aws/sqs",
255
- "RedrivePolicy": {
256
- "deadLetterTargetArn": {
257
- "Fn::GetAtt": [
258
- "testsqslambdadeadLetterQueue85BDB0A3",
259
- "Arn"
260
- ]
261
- },
262
- "maxReceiveCount": 3
263
- }
264
- },
265
- "UpdateReplacePolicy": "Delete",
266
- "DeletionPolicy": "Delete"
267
- },
268
- "testsqslambdaqueuePolicy29B871D4": {
269
- "Type": "AWS::SQS::QueuePolicy",
270
- "Properties": {
271
- "PolicyDocument": {
272
- "Statement": [
273
- {
274
- "Action": [
275
- "sqs:DeleteMessage",
276
- "sqs:ReceiveMessage",
277
- "sqs:SendMessage",
278
- "sqs:GetQueueAttributes",
279
- "sqs:RemovePermission",
280
- "sqs:AddPermission",
281
- "sqs:SetQueueAttributes"
282
- ],
283
- "Effect": "Allow",
284
- "Principal": {
285
- "AWS": {
286
- "Fn::Join": [
287
- "",
288
- [
289
- "arn:",
290
- {
291
- "Ref": "AWS::Partition"
292
- },
293
- ":iam::",
294
- {
295
- "Ref": "AWS::AccountId"
296
- },
297
- ":root"
298
- ]
299
- ]
300
- }
301
- },
302
- "Resource": {
303
- "Fn::GetAtt": [
304
- "testsqslambdaqueue601203B8",
305
- "Arn"
306
- ]
307
- },
308
- "Sid": "QueueOwnerOnlyAccess"
309
- },
310
- {
311
- "Action": "SQS:*",
312
- "Condition": {
313
- "Bool": {
314
- "aws:SecureTransport": "false"
315
- }
316
- },
317
- "Effect": "Deny",
318
- "Principal": {
319
- "AWS": "*"
320
- },
321
- "Resource": {
322
- "Fn::GetAtt": [
323
- "testsqslambdaqueue601203B8",
324
- "Arn"
325
- ]
326
- },
327
- "Sid": "HttpsOnly"
328
- }
329
- ],
330
- "Version": "2012-10-17"
331
- },
332
- "Queues": [
333
- {
334
- "Ref": "testsqslambdaqueue601203B8"
335
- }
336
- ]
337
- }
338
- }
339
- },
340
- "Parameters": {
341
- "BootstrapVersion": {
342
- "Type": "AWS::SSM::Parameter::Value<String>",
343
- "Default": "/cdk-bootstrap/hnb659fds/version",
344
- "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
345
- }
346
- },
347
- "Rules": {
348
- "CheckBootstrapVersion": {
349
- "Assertions": [
350
- {
351
- "Assert": {
352
- "Fn::Not": [
353
- {
354
- "Fn::Contains": [
355
- [
356
- "1",
357
- "2",
358
- "3",
359
- "4",
360
- "5"
361
- ],
362
- {
363
- "Ref": "BootstrapVersion"
364
- }
365
- ]
366
- }
367
- ]
368
- },
369
- "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
370
- }
371
- ]
372
- }
373
- }
374
- }