@aws-solutions-constructs/aws-lambda-sns 2.50.0 → 2.52.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.
Files changed (40) hide show
  1. package/.eslintignore +2 -0
  2. package/.jsii +50 -5
  3. package/integ.config.json +7 -0
  4. package/lib/index.js +1 -1
  5. package/package.json +12 -11
  6. package/test/integ.lamsns-deployFunction.js +5 -2
  7. package/test/integ.lamsns-deployFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  8. package/test/integ.lamsns-deployFunction.js.snapshot/cdk.out +1 -0
  9. package/test/integ.lamsns-deployFunction.js.snapshot/integ.json +12 -0
  10. package/test/integ.lamsns-deployFunction.js.snapshot/lamsns-deployFunction.assets.json +32 -0
  11. package/test/integ.lamsns-deployFunction.js.snapshot/lamsns-deployFunction.template.json +302 -0
  12. package/test/integ.lamsns-deployFunction.js.snapshot/lamsnsdeployFunctionIntegDefaultTestDeployAssert36FE5D09.assets.json +19 -0
  13. package/test/integ.lamsns-deployFunction.js.snapshot/lamsnsdeployFunctionIntegDefaultTestDeployAssert36FE5D09.template.json +36 -0
  14. package/test/integ.lamsns-deployFunction.js.snapshot/manifest.json +137 -0
  15. package/test/integ.lamsns-deployFunction.js.snapshot/tree.json +474 -0
  16. package/test/integ.lamsns-deployFunctionWithVpc.js +6 -2
  17. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  18. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
  19. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
  20. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/cdk.out +1 -0
  21. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/integ.json +12 -0
  22. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsns-deployFunctionWithVpc.assets.json +45 -0
  23. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsns-deployFunctionWithVpc.template.json +829 -0
  24. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsnsdeployFunctionWithVpcIntegDefaultTestDeployAssertEDF33408.assets.json +19 -0
  25. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsnsdeployFunctionWithVpcIntegDefaultTestDeployAssertEDF33408.template.json +36 -0
  26. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/manifest.json +239 -0
  27. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/tree.json +1113 -0
  28. package/test/integ.lamsns-existingFunction.js +5 -2
  29. package/test/integ.lamsns-existingFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  30. package/test/integ.lamsns-existingFunction.js.snapshot/cdk.out +1 -0
  31. package/test/integ.lamsns-existingFunction.js.snapshot/integ.json +12 -0
  32. package/test/integ.lamsns-existingFunction.js.snapshot/lamsns-existingFunction.assets.json +32 -0
  33. package/test/integ.lamsns-existingFunction.js.snapshot/lamsns-existingFunction.template.json +302 -0
  34. package/test/integ.lamsns-existingFunction.js.snapshot/lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.assets.json +19 -0
  35. package/test/integ.lamsns-existingFunction.js.snapshot/lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.template.json +36 -0
  36. package/test/integ.lamsns-existingFunction.js.snapshot/manifest.json +137 -0
  37. package/test/integ.lamsns-existingFunction.js.snapshot/tree.json +474 -0
  38. package/test/integ.lamsns-deployFunction.expected.json +0 -302
  39. package/test/integ.lamsns-deployFunctionWithVpc.expected.json +0 -744
  40. package/test/integ.lamsns-existingFunction.expected.json +0 -302
@@ -0,0 +1,474 @@
1
+ {
2
+ "version": "tree-0.1",
3
+ "tree": {
4
+ "id": "App",
5
+ "path": "",
6
+ "children": {
7
+ "lamsns-existingFunction": {
8
+ "id": "lamsns-existingFunction",
9
+ "path": "lamsns-existingFunction",
10
+ "children": {
11
+ "LambdaFunctionServiceRole": {
12
+ "id": "LambdaFunctionServiceRole",
13
+ "path": "lamsns-existingFunction/LambdaFunctionServiceRole",
14
+ "children": {
15
+ "ImportLambdaFunctionServiceRole": {
16
+ "id": "ImportLambdaFunctionServiceRole",
17
+ "path": "lamsns-existingFunction/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole",
18
+ "constructInfo": {
19
+ "fqn": "aws-cdk-lib.Resource",
20
+ "version": "2.118.0"
21
+ }
22
+ },
23
+ "Resource": {
24
+ "id": "Resource",
25
+ "path": "lamsns-existingFunction/LambdaFunctionServiceRole/Resource",
26
+ "attributes": {
27
+ "aws:cdk:cloudformation:type": "AWS::IAM::Role",
28
+ "aws:cdk:cloudformation:props": {
29
+ "assumeRolePolicyDocument": {
30
+ "Statement": [
31
+ {
32
+ "Action": "sts:AssumeRole",
33
+ "Effect": "Allow",
34
+ "Principal": {
35
+ "Service": "lambda.amazonaws.com"
36
+ }
37
+ }
38
+ ],
39
+ "Version": "2012-10-17"
40
+ },
41
+ "policies": [
42
+ {
43
+ "policyName": "LambdaFunctionServiceRolePolicy",
44
+ "policyDocument": {
45
+ "Statement": [
46
+ {
47
+ "Action": [
48
+ "logs:CreateLogGroup",
49
+ "logs:CreateLogStream",
50
+ "logs:PutLogEvents"
51
+ ],
52
+ "Effect": "Allow",
53
+ "Resource": {
54
+ "Fn::Join": [
55
+ "",
56
+ [
57
+ "arn:",
58
+ {
59
+ "Ref": "AWS::Partition"
60
+ },
61
+ ":logs:",
62
+ {
63
+ "Ref": "AWS::Region"
64
+ },
65
+ ":",
66
+ {
67
+ "Ref": "AWS::AccountId"
68
+ },
69
+ ":log-group:/aws/lambda/*"
70
+ ]
71
+ ]
72
+ }
73
+ }
74
+ ],
75
+ "Version": "2012-10-17"
76
+ }
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ "constructInfo": {
82
+ "fqn": "aws-cdk-lib.aws_iam.CfnRole",
83
+ "version": "2.118.0"
84
+ }
85
+ },
86
+ "DefaultPolicy": {
87
+ "id": "DefaultPolicy",
88
+ "path": "lamsns-existingFunction/LambdaFunctionServiceRole/DefaultPolicy",
89
+ "children": {
90
+ "Resource": {
91
+ "id": "Resource",
92
+ "path": "lamsns-existingFunction/LambdaFunctionServiceRole/DefaultPolicy/Resource",
93
+ "attributes": {
94
+ "aws:cdk:cloudformation:type": "AWS::IAM::Policy",
95
+ "aws:cdk:cloudformation:props": {
96
+ "policyDocument": {
97
+ "Statement": [
98
+ {
99
+ "Action": [
100
+ "xray:PutTelemetryRecords",
101
+ "xray:PutTraceSegments"
102
+ ],
103
+ "Effect": "Allow",
104
+ "Resource": "*"
105
+ },
106
+ {
107
+ "Action": "sns:Publish",
108
+ "Effect": "Allow",
109
+ "Resource": {
110
+ "Ref": "testlambdasnsSnsTopic57DFED98"
111
+ }
112
+ }
113
+ ],
114
+ "Version": "2012-10-17"
115
+ },
116
+ "policyName": "LambdaFunctionServiceRoleDefaultPolicy126C8897",
117
+ "roles": [
118
+ {
119
+ "Ref": "LambdaFunctionServiceRole0C4CDE0B"
120
+ }
121
+ ]
122
+ }
123
+ },
124
+ "constructInfo": {
125
+ "fqn": "aws-cdk-lib.aws_iam.CfnPolicy",
126
+ "version": "2.118.0"
127
+ }
128
+ }
129
+ },
130
+ "constructInfo": {
131
+ "fqn": "aws-cdk-lib.aws_iam.Policy",
132
+ "version": "2.118.0"
133
+ }
134
+ }
135
+ },
136
+ "constructInfo": {
137
+ "fqn": "aws-cdk-lib.aws_iam.Role",
138
+ "version": "2.118.0"
139
+ }
140
+ },
141
+ "LambdaFunction": {
142
+ "id": "LambdaFunction",
143
+ "path": "lamsns-existingFunction/LambdaFunction",
144
+ "children": {
145
+ "Code": {
146
+ "id": "Code",
147
+ "path": "lamsns-existingFunction/LambdaFunction/Code",
148
+ "children": {
149
+ "Stage": {
150
+ "id": "Stage",
151
+ "path": "lamsns-existingFunction/LambdaFunction/Code/Stage",
152
+ "constructInfo": {
153
+ "fqn": "aws-cdk-lib.AssetStaging",
154
+ "version": "2.118.0"
155
+ }
156
+ },
157
+ "AssetBucket": {
158
+ "id": "AssetBucket",
159
+ "path": "lamsns-existingFunction/LambdaFunction/Code/AssetBucket",
160
+ "constructInfo": {
161
+ "fqn": "aws-cdk-lib.aws_s3.BucketBase",
162
+ "version": "2.118.0"
163
+ }
164
+ }
165
+ },
166
+ "constructInfo": {
167
+ "fqn": "aws-cdk-lib.aws_s3_assets.Asset",
168
+ "version": "2.118.0"
169
+ }
170
+ },
171
+ "Resource": {
172
+ "id": "Resource",
173
+ "path": "lamsns-existingFunction/LambdaFunction/Resource",
174
+ "attributes": {
175
+ "aws:cdk:cloudformation:type": "AWS::Lambda::Function",
176
+ "aws:cdk:cloudformation:props": {
177
+ "code": {
178
+ "s3Bucket": {
179
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
180
+ },
181
+ "s3Key": "0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f.zip"
182
+ },
183
+ "environment": {
184
+ "variables": {
185
+ "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
186
+ "SNS_TOPIC_ARN": {
187
+ "Ref": "testlambdasnsSnsTopic57DFED98"
188
+ },
189
+ "SNS_TOPIC_NAME": {
190
+ "Fn::GetAtt": [
191
+ "testlambdasnsSnsTopic57DFED98",
192
+ "TopicName"
193
+ ]
194
+ }
195
+ }
196
+ },
197
+ "handler": "index.handler",
198
+ "role": {
199
+ "Fn::GetAtt": [
200
+ "LambdaFunctionServiceRole0C4CDE0B",
201
+ "Arn"
202
+ ]
203
+ },
204
+ "runtime": "nodejs16.x",
205
+ "tracingConfig": {
206
+ "mode": "Active"
207
+ }
208
+ }
209
+ },
210
+ "constructInfo": {
211
+ "fqn": "aws-cdk-lib.aws_lambda.CfnFunction",
212
+ "version": "2.118.0"
213
+ }
214
+ }
215
+ },
216
+ "constructInfo": {
217
+ "fqn": "aws-cdk-lib.aws_lambda.Function",
218
+ "version": "2.118.0"
219
+ }
220
+ },
221
+ "test-lambda-sns": {
222
+ "id": "test-lambda-sns",
223
+ "path": "lamsns-existingFunction/test-lambda-sns",
224
+ "children": {
225
+ "aws-managed-key": {
226
+ "id": "aws-managed-key",
227
+ "path": "lamsns-existingFunction/test-lambda-sns/aws-managed-key",
228
+ "constructInfo": {
229
+ "fqn": "aws-cdk-lib.Resource",
230
+ "version": "2.118.0"
231
+ }
232
+ },
233
+ "SnsTopic": {
234
+ "id": "SnsTopic",
235
+ "path": "lamsns-existingFunction/test-lambda-sns/SnsTopic",
236
+ "children": {
237
+ "Resource": {
238
+ "id": "Resource",
239
+ "path": "lamsns-existingFunction/test-lambda-sns/SnsTopic/Resource",
240
+ "attributes": {
241
+ "aws:cdk:cloudformation:type": "AWS::SNS::Topic",
242
+ "aws:cdk:cloudformation:props": {
243
+ "kmsMasterKeyId": {
244
+ "Fn::Join": [
245
+ "",
246
+ [
247
+ "arn:",
248
+ {
249
+ "Ref": "AWS::Partition"
250
+ },
251
+ ":kms:",
252
+ {
253
+ "Ref": "AWS::Region"
254
+ },
255
+ ":",
256
+ {
257
+ "Ref": "AWS::AccountId"
258
+ },
259
+ ":alias/aws/sns"
260
+ ]
261
+ ]
262
+ }
263
+ }
264
+ },
265
+ "constructInfo": {
266
+ "fqn": "aws-cdk-lib.aws_sns.CfnTopic",
267
+ "version": "2.118.0"
268
+ }
269
+ },
270
+ "Policy": {
271
+ "id": "Policy",
272
+ "path": "lamsns-existingFunction/test-lambda-sns/SnsTopic/Policy",
273
+ "children": {
274
+ "Resource": {
275
+ "id": "Resource",
276
+ "path": "lamsns-existingFunction/test-lambda-sns/SnsTopic/Policy/Resource",
277
+ "attributes": {
278
+ "aws:cdk:cloudformation:type": "AWS::SNS::TopicPolicy",
279
+ "aws:cdk:cloudformation:props": {
280
+ "policyDocument": {
281
+ "Statement": [
282
+ {
283
+ "Action": [
284
+ "SNS:AddPermission",
285
+ "SNS:DeleteTopic",
286
+ "SNS:GetTopicAttributes",
287
+ "SNS:ListSubscriptionsByTopic",
288
+ "SNS:Publish",
289
+ "SNS:Receive",
290
+ "SNS:RemovePermission",
291
+ "SNS:SetTopicAttributes",
292
+ "SNS:Subscribe"
293
+ ],
294
+ "Condition": {
295
+ "StringEquals": {
296
+ "AWS:SourceOwner": {
297
+ "Ref": "AWS::AccountId"
298
+ }
299
+ }
300
+ },
301
+ "Effect": "Allow",
302
+ "Principal": {
303
+ "AWS": {
304
+ "Fn::Join": [
305
+ "",
306
+ [
307
+ "arn:",
308
+ {
309
+ "Ref": "AWS::Partition"
310
+ },
311
+ ":iam::",
312
+ {
313
+ "Ref": "AWS::AccountId"
314
+ },
315
+ ":root"
316
+ ]
317
+ ]
318
+ }
319
+ },
320
+ "Resource": {
321
+ "Ref": "testlambdasnsSnsTopic57DFED98"
322
+ },
323
+ "Sid": "TopicOwnerOnlyAccess"
324
+ },
325
+ {
326
+ "Action": [
327
+ "SNS:AddPermission",
328
+ "SNS:DeleteTopic",
329
+ "SNS:GetTopicAttributes",
330
+ "SNS:ListSubscriptionsByTopic",
331
+ "SNS:Publish",
332
+ "SNS:Receive",
333
+ "SNS:RemovePermission",
334
+ "SNS:SetTopicAttributes",
335
+ "SNS:Subscribe"
336
+ ],
337
+ "Condition": {
338
+ "Bool": {
339
+ "aws:SecureTransport": "false"
340
+ }
341
+ },
342
+ "Effect": "Deny",
343
+ "Principal": {
344
+ "AWS": "*"
345
+ },
346
+ "Resource": {
347
+ "Ref": "testlambdasnsSnsTopic57DFED98"
348
+ },
349
+ "Sid": "HttpsOnly"
350
+ }
351
+ ],
352
+ "Version": "2012-10-17"
353
+ },
354
+ "topics": [
355
+ {
356
+ "Ref": "testlambdasnsSnsTopic57DFED98"
357
+ }
358
+ ]
359
+ }
360
+ },
361
+ "constructInfo": {
362
+ "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy",
363
+ "version": "2.118.0"
364
+ }
365
+ }
366
+ },
367
+ "constructInfo": {
368
+ "fqn": "aws-cdk-lib.aws_sns.TopicPolicy",
369
+ "version": "2.118.0"
370
+ }
371
+ }
372
+ },
373
+ "constructInfo": {
374
+ "fqn": "aws-cdk-lib.aws_sns.Topic",
375
+ "version": "2.118.0"
376
+ }
377
+ }
378
+ },
379
+ "constructInfo": {
380
+ "fqn": "@aws-solutions-constructs/aws-lambda-sns.LambdaToSns",
381
+ "version": "2.50.0"
382
+ }
383
+ },
384
+ "Integ": {
385
+ "id": "Integ",
386
+ "path": "lamsns-existingFunction/Integ",
387
+ "children": {
388
+ "DefaultTest": {
389
+ "id": "DefaultTest",
390
+ "path": "lamsns-existingFunction/Integ/DefaultTest",
391
+ "children": {
392
+ "Default": {
393
+ "id": "Default",
394
+ "path": "lamsns-existingFunction/Integ/DefaultTest/Default",
395
+ "constructInfo": {
396
+ "fqn": "constructs.Construct",
397
+ "version": "10.0.0"
398
+ }
399
+ },
400
+ "DeployAssert": {
401
+ "id": "DeployAssert",
402
+ "path": "lamsns-existingFunction/Integ/DefaultTest/DeployAssert",
403
+ "children": {
404
+ "BootstrapVersion": {
405
+ "id": "BootstrapVersion",
406
+ "path": "lamsns-existingFunction/Integ/DefaultTest/DeployAssert/BootstrapVersion",
407
+ "constructInfo": {
408
+ "fqn": "aws-cdk-lib.CfnParameter",
409
+ "version": "2.118.0"
410
+ }
411
+ },
412
+ "CheckBootstrapVersion": {
413
+ "id": "CheckBootstrapVersion",
414
+ "path": "lamsns-existingFunction/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion",
415
+ "constructInfo": {
416
+ "fqn": "aws-cdk-lib.CfnRule",
417
+ "version": "2.118.0"
418
+ }
419
+ }
420
+ },
421
+ "constructInfo": {
422
+ "fqn": "aws-cdk-lib.Stack",
423
+ "version": "2.118.0"
424
+ }
425
+ }
426
+ },
427
+ "constructInfo": {
428
+ "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase",
429
+ "version": "2.118.0-alpha.0"
430
+ }
431
+ }
432
+ },
433
+ "constructInfo": {
434
+ "fqn": "@aws-cdk/integ-tests-alpha.IntegTest",
435
+ "version": "2.118.0-alpha.0"
436
+ }
437
+ },
438
+ "BootstrapVersion": {
439
+ "id": "BootstrapVersion",
440
+ "path": "lamsns-existingFunction/BootstrapVersion",
441
+ "constructInfo": {
442
+ "fqn": "aws-cdk-lib.CfnParameter",
443
+ "version": "2.118.0"
444
+ }
445
+ },
446
+ "CheckBootstrapVersion": {
447
+ "id": "CheckBootstrapVersion",
448
+ "path": "lamsns-existingFunction/CheckBootstrapVersion",
449
+ "constructInfo": {
450
+ "fqn": "aws-cdk-lib.CfnRule",
451
+ "version": "2.118.0"
452
+ }
453
+ }
454
+ },
455
+ "constructInfo": {
456
+ "fqn": "aws-cdk-lib.Stack",
457
+ "version": "2.118.0"
458
+ }
459
+ },
460
+ "Tree": {
461
+ "id": "Tree",
462
+ "path": "Tree",
463
+ "constructInfo": {
464
+ "fqn": "constructs.Construct",
465
+ "version": "10.0.0"
466
+ }
467
+ }
468
+ },
469
+ "constructInfo": {
470
+ "fqn": "aws-cdk-lib.App",
471
+ "version": "2.118.0"
472
+ }
473
+ }
474
+ }