@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,829 @@
1
+ {
2
+ "Description": "Integration Test for aws-lambda-sns",
3
+ "Resources": {
4
+ "testlambdasnsLambdaFunctionServiceRole9C412F74": {
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
+ "testlambdasnsLambdaFunctionServiceRoleDefaultPolicyBB1D55CB": {
60
+ "Type": "AWS::IAM::Policy",
61
+ "Properties": {
62
+ "PolicyDocument": {
63
+ "Statement": [
64
+ {
65
+ "Action": [
66
+ "ec2:AssignPrivateIpAddresses",
67
+ "ec2:CreateNetworkInterface",
68
+ "ec2:DeleteNetworkInterface",
69
+ "ec2:DescribeNetworkInterfaces",
70
+ "ec2:UnassignPrivateIpAddresses",
71
+ "xray:PutTelemetryRecords",
72
+ "xray:PutTraceSegments"
73
+ ],
74
+ "Effect": "Allow",
75
+ "Resource": "*"
76
+ },
77
+ {
78
+ "Action": "sns:Publish",
79
+ "Effect": "Allow",
80
+ "Resource": {
81
+ "Ref": "testlambdasnsSnsTopic57DFED98"
82
+ }
83
+ }
84
+ ],
85
+ "Version": "2012-10-17"
86
+ },
87
+ "PolicyName": "testlambdasnsLambdaFunctionServiceRoleDefaultPolicyBB1D55CB",
88
+ "Roles": [
89
+ {
90
+ "Ref": "testlambdasnsLambdaFunctionServiceRole9C412F74"
91
+ }
92
+ ]
93
+ },
94
+ "Metadata": {
95
+ "cfn_nag": {
96
+ "rules_to_suppress": [
97
+ {
98
+ "id": "W12",
99
+ "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
100
+ }
101
+ ]
102
+ }
103
+ }
104
+ },
105
+ "testlambdasnsReplaceDefaultSecurityGroupsecuritygroup071D13CB": {
106
+ "Type": "AWS::EC2::SecurityGroup",
107
+ "Properties": {
108
+ "GroupDescription": "lamsns-deployFunctionWithVpc/test-lambda-sns/ReplaceDefaultSecurityGroup-security-group",
109
+ "SecurityGroupEgress": [
110
+ {
111
+ "CidrIp": "0.0.0.0/0",
112
+ "Description": "Allow all outbound traffic by default",
113
+ "IpProtocol": "-1"
114
+ }
115
+ ],
116
+ "VpcId": {
117
+ "Ref": "Vpc8378EB38"
118
+ }
119
+ },
120
+ "Metadata": {
121
+ "cfn_nag": {
122
+ "rules_to_suppress": [
123
+ {
124
+ "id": "W5",
125
+ "reason": "Egress of 0.0.0.0/0 is default and generally considered OK"
126
+ },
127
+ {
128
+ "id": "W40",
129
+ "reason": "Egress IPProtocol of -1 is default and generally considered OK"
130
+ }
131
+ ]
132
+ }
133
+ }
134
+ },
135
+ "testlambdasnsLambdaFunctionD8BC8ABA": {
136
+ "Type": "AWS::Lambda::Function",
137
+ "Properties": {
138
+ "Code": {
139
+ "S3Bucket": {
140
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
141
+ },
142
+ "S3Key": "0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f.zip"
143
+ },
144
+ "Environment": {
145
+ "Variables": {
146
+ "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
147
+ "SNS_TOPIC_ARN": {
148
+ "Ref": "testlambdasnsSnsTopic57DFED98"
149
+ },
150
+ "SNS_TOPIC_NAME": {
151
+ "Fn::GetAtt": [
152
+ "testlambdasnsSnsTopic57DFED98",
153
+ "TopicName"
154
+ ]
155
+ }
156
+ }
157
+ },
158
+ "Handler": "index.handler",
159
+ "Role": {
160
+ "Fn::GetAtt": [
161
+ "testlambdasnsLambdaFunctionServiceRole9C412F74",
162
+ "Arn"
163
+ ]
164
+ },
165
+ "Runtime": "nodejs16.x",
166
+ "TracingConfig": {
167
+ "Mode": "Active"
168
+ },
169
+ "VpcConfig": {
170
+ "SecurityGroupIds": [
171
+ {
172
+ "Fn::GetAtt": [
173
+ "testlambdasnsReplaceDefaultSecurityGroupsecuritygroup071D13CB",
174
+ "GroupId"
175
+ ]
176
+ }
177
+ ],
178
+ "SubnetIds": [
179
+ {
180
+ "Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
181
+ },
182
+ {
183
+ "Ref": "VpcisolatedSubnet2Subnet39217055"
184
+ }
185
+ ]
186
+ }
187
+ },
188
+ "DependsOn": [
189
+ "testlambdasnsLambdaFunctionServiceRoleDefaultPolicyBB1D55CB",
190
+ "testlambdasnsLambdaFunctionServiceRole9C412F74",
191
+ "VpcisolatedSubnet1RouteTableAssociationD259E31A",
192
+ "VpcisolatedSubnet2RouteTableAssociation25A4716F"
193
+ ],
194
+ "Metadata": {
195
+ "cfn_nag": {
196
+ "rules_to_suppress": [
197
+ {
198
+ "id": "W58",
199
+ "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."
200
+ },
201
+ {
202
+ "id": "W89",
203
+ "reason": "This is not a rule for the general case, just for specific use cases/industries"
204
+ },
205
+ {
206
+ "id": "W92",
207
+ "reason": "Impossible for us to define the correct concurrency for clients"
208
+ }
209
+ ]
210
+ }
211
+ }
212
+ },
213
+ "testlambdasnsSnsTopic57DFED98": {
214
+ "Type": "AWS::SNS::Topic",
215
+ "Properties": {
216
+ "KmsMasterKeyId": {
217
+ "Fn::Join": [
218
+ "",
219
+ [
220
+ "arn:",
221
+ {
222
+ "Ref": "AWS::Partition"
223
+ },
224
+ ":kms:",
225
+ {
226
+ "Ref": "AWS::Region"
227
+ },
228
+ ":",
229
+ {
230
+ "Ref": "AWS::AccountId"
231
+ },
232
+ ":alias/aws/sns"
233
+ ]
234
+ ]
235
+ }
236
+ }
237
+ },
238
+ "testlambdasnsSnsTopicPolicy4481ABC3": {
239
+ "Type": "AWS::SNS::TopicPolicy",
240
+ "Properties": {
241
+ "PolicyDocument": {
242
+ "Statement": [
243
+ {
244
+ "Action": [
245
+ "SNS:AddPermission",
246
+ "SNS:DeleteTopic",
247
+ "SNS:GetTopicAttributes",
248
+ "SNS:ListSubscriptionsByTopic",
249
+ "SNS:Publish",
250
+ "SNS:Receive",
251
+ "SNS:RemovePermission",
252
+ "SNS:SetTopicAttributes",
253
+ "SNS:Subscribe"
254
+ ],
255
+ "Condition": {
256
+ "StringEquals": {
257
+ "AWS:SourceOwner": {
258
+ "Ref": "AWS::AccountId"
259
+ }
260
+ }
261
+ },
262
+ "Effect": "Allow",
263
+ "Principal": {
264
+ "AWS": {
265
+ "Fn::Join": [
266
+ "",
267
+ [
268
+ "arn:",
269
+ {
270
+ "Ref": "AWS::Partition"
271
+ },
272
+ ":iam::",
273
+ {
274
+ "Ref": "AWS::AccountId"
275
+ },
276
+ ":root"
277
+ ]
278
+ ]
279
+ }
280
+ },
281
+ "Resource": {
282
+ "Ref": "testlambdasnsSnsTopic57DFED98"
283
+ },
284
+ "Sid": "TopicOwnerOnlyAccess"
285
+ },
286
+ {
287
+ "Action": [
288
+ "SNS:AddPermission",
289
+ "SNS:DeleteTopic",
290
+ "SNS:GetTopicAttributes",
291
+ "SNS:ListSubscriptionsByTopic",
292
+ "SNS:Publish",
293
+ "SNS:Receive",
294
+ "SNS:RemovePermission",
295
+ "SNS:SetTopicAttributes",
296
+ "SNS:Subscribe"
297
+ ],
298
+ "Condition": {
299
+ "Bool": {
300
+ "aws:SecureTransport": "false"
301
+ }
302
+ },
303
+ "Effect": "Deny",
304
+ "Principal": {
305
+ "AWS": "*"
306
+ },
307
+ "Resource": {
308
+ "Ref": "testlambdasnsSnsTopic57DFED98"
309
+ },
310
+ "Sid": "HttpsOnly"
311
+ }
312
+ ],
313
+ "Version": "2012-10-17"
314
+ },
315
+ "Topics": [
316
+ {
317
+ "Ref": "testlambdasnsSnsTopic57DFED98"
318
+ }
319
+ ]
320
+ }
321
+ },
322
+ "Vpc8378EB38": {
323
+ "Type": "AWS::EC2::VPC",
324
+ "Properties": {
325
+ "CidrBlock": "10.0.0.0/16",
326
+ "EnableDnsHostnames": true,
327
+ "EnableDnsSupport": true,
328
+ "InstanceTenancy": "default",
329
+ "Tags": [
330
+ {
331
+ "Key": "Name",
332
+ "Value": "lamsns-deployFunctionWithVpc/Vpc"
333
+ }
334
+ ]
335
+ }
336
+ },
337
+ "VpcisolatedSubnet1SubnetE62B1B9B": {
338
+ "Type": "AWS::EC2::Subnet",
339
+ "Properties": {
340
+ "AvailabilityZone": {
341
+ "Fn::Select": [
342
+ 0,
343
+ {
344
+ "Fn::GetAZs": ""
345
+ }
346
+ ]
347
+ },
348
+ "CidrBlock": "10.0.0.0/18",
349
+ "MapPublicIpOnLaunch": false,
350
+ "Tags": [
351
+ {
352
+ "Key": "aws-cdk:subnet-name",
353
+ "Value": "isolated"
354
+ },
355
+ {
356
+ "Key": "aws-cdk:subnet-type",
357
+ "Value": "Isolated"
358
+ },
359
+ {
360
+ "Key": "Name",
361
+ "Value": "lamsns-deployFunctionWithVpc/Vpc/isolatedSubnet1"
362
+ }
363
+ ],
364
+ "VpcId": {
365
+ "Ref": "Vpc8378EB38"
366
+ }
367
+ }
368
+ },
369
+ "VpcisolatedSubnet1RouteTableE442650B": {
370
+ "Type": "AWS::EC2::RouteTable",
371
+ "Properties": {
372
+ "Tags": [
373
+ {
374
+ "Key": "Name",
375
+ "Value": "lamsns-deployFunctionWithVpc/Vpc/isolatedSubnet1"
376
+ }
377
+ ],
378
+ "VpcId": {
379
+ "Ref": "Vpc8378EB38"
380
+ }
381
+ }
382
+ },
383
+ "VpcisolatedSubnet1RouteTableAssociationD259E31A": {
384
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
385
+ "Properties": {
386
+ "RouteTableId": {
387
+ "Ref": "VpcisolatedSubnet1RouteTableE442650B"
388
+ },
389
+ "SubnetId": {
390
+ "Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
391
+ }
392
+ }
393
+ },
394
+ "VpcisolatedSubnet2Subnet39217055": {
395
+ "Type": "AWS::EC2::Subnet",
396
+ "Properties": {
397
+ "AvailabilityZone": {
398
+ "Fn::Select": [
399
+ 1,
400
+ {
401
+ "Fn::GetAZs": ""
402
+ }
403
+ ]
404
+ },
405
+ "CidrBlock": "10.0.64.0/18",
406
+ "MapPublicIpOnLaunch": false,
407
+ "Tags": [
408
+ {
409
+ "Key": "aws-cdk:subnet-name",
410
+ "Value": "isolated"
411
+ },
412
+ {
413
+ "Key": "aws-cdk:subnet-type",
414
+ "Value": "Isolated"
415
+ },
416
+ {
417
+ "Key": "Name",
418
+ "Value": "lamsns-deployFunctionWithVpc/Vpc/isolatedSubnet2"
419
+ }
420
+ ],
421
+ "VpcId": {
422
+ "Ref": "Vpc8378EB38"
423
+ }
424
+ }
425
+ },
426
+ "VpcisolatedSubnet2RouteTable334F9764": {
427
+ "Type": "AWS::EC2::RouteTable",
428
+ "Properties": {
429
+ "Tags": [
430
+ {
431
+ "Key": "Name",
432
+ "Value": "lamsns-deployFunctionWithVpc/Vpc/isolatedSubnet2"
433
+ }
434
+ ],
435
+ "VpcId": {
436
+ "Ref": "Vpc8378EB38"
437
+ }
438
+ }
439
+ },
440
+ "VpcisolatedSubnet2RouteTableAssociation25A4716F": {
441
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
442
+ "Properties": {
443
+ "RouteTableId": {
444
+ "Ref": "VpcisolatedSubnet2RouteTable334F9764"
445
+ },
446
+ "SubnetId": {
447
+ "Ref": "VpcisolatedSubnet2Subnet39217055"
448
+ }
449
+ }
450
+ },
451
+ "VpcRestrictDefaultSecurityGroupCustomResourceC73DA2BE": {
452
+ "Type": "Custom::VpcRestrictDefaultSG",
453
+ "Properties": {
454
+ "ServiceToken": {
455
+ "Fn::GetAtt": [
456
+ "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E",
457
+ "Arn"
458
+ ]
459
+ },
460
+ "DefaultSecurityGroupId": {
461
+ "Fn::GetAtt": [
462
+ "Vpc8378EB38",
463
+ "DefaultSecurityGroup"
464
+ ]
465
+ },
466
+ "Account": {
467
+ "Ref": "AWS::AccountId"
468
+ }
469
+ },
470
+ "UpdateReplacePolicy": "Delete",
471
+ "DeletionPolicy": "Delete"
472
+ },
473
+ "VpcFlowLogIAMRole6A475D41": {
474
+ "Type": "AWS::IAM::Role",
475
+ "Properties": {
476
+ "AssumeRolePolicyDocument": {
477
+ "Statement": [
478
+ {
479
+ "Action": "sts:AssumeRole",
480
+ "Effect": "Allow",
481
+ "Principal": {
482
+ "Service": "vpc-flow-logs.amazonaws.com"
483
+ }
484
+ }
485
+ ],
486
+ "Version": "2012-10-17"
487
+ },
488
+ "Tags": [
489
+ {
490
+ "Key": "Name",
491
+ "Value": "lamsns-deployFunctionWithVpc/Vpc/FlowLog"
492
+ }
493
+ ]
494
+ }
495
+ },
496
+ "VpcFlowLogIAMRoleDefaultPolicy406FB995": {
497
+ "Type": "AWS::IAM::Policy",
498
+ "Properties": {
499
+ "PolicyDocument": {
500
+ "Statement": [
501
+ {
502
+ "Action": [
503
+ "logs:CreateLogStream",
504
+ "logs:DescribeLogStreams",
505
+ "logs:PutLogEvents"
506
+ ],
507
+ "Effect": "Allow",
508
+ "Resource": {
509
+ "Fn::GetAtt": [
510
+ "VpcFlowLogLogGroup7B5C56B9",
511
+ "Arn"
512
+ ]
513
+ }
514
+ },
515
+ {
516
+ "Action": "iam:PassRole",
517
+ "Effect": "Allow",
518
+ "Resource": {
519
+ "Fn::GetAtt": [
520
+ "VpcFlowLogIAMRole6A475D41",
521
+ "Arn"
522
+ ]
523
+ }
524
+ }
525
+ ],
526
+ "Version": "2012-10-17"
527
+ },
528
+ "PolicyName": "VpcFlowLogIAMRoleDefaultPolicy406FB995",
529
+ "Roles": [
530
+ {
531
+ "Ref": "VpcFlowLogIAMRole6A475D41"
532
+ }
533
+ ]
534
+ }
535
+ },
536
+ "VpcFlowLogLogGroup7B5C56B9": {
537
+ "Type": "AWS::Logs::LogGroup",
538
+ "Properties": {
539
+ "RetentionInDays": 731,
540
+ "Tags": [
541
+ {
542
+ "Key": "Name",
543
+ "Value": "lamsns-deployFunctionWithVpc/Vpc/FlowLog"
544
+ }
545
+ ]
546
+ },
547
+ "UpdateReplacePolicy": "Retain",
548
+ "DeletionPolicy": "Retain",
549
+ "Metadata": {
550
+ "cfn_nag": {
551
+ "rules_to_suppress": [
552
+ {
553
+ "id": "W84",
554
+ "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
555
+ }
556
+ ]
557
+ }
558
+ }
559
+ },
560
+ "VpcFlowLog8FF33A73": {
561
+ "Type": "AWS::EC2::FlowLog",
562
+ "Properties": {
563
+ "DeliverLogsPermissionArn": {
564
+ "Fn::GetAtt": [
565
+ "VpcFlowLogIAMRole6A475D41",
566
+ "Arn"
567
+ ]
568
+ },
569
+ "LogDestinationType": "cloud-watch-logs",
570
+ "LogGroupName": {
571
+ "Ref": "VpcFlowLogLogGroup7B5C56B9"
572
+ },
573
+ "ResourceId": {
574
+ "Ref": "Vpc8378EB38"
575
+ },
576
+ "ResourceType": "VPC",
577
+ "Tags": [
578
+ {
579
+ "Key": "Name",
580
+ "Value": "lamsns-deployFunctionWithVpc/Vpc/FlowLog"
581
+ }
582
+ ],
583
+ "TrafficType": "ALL"
584
+ }
585
+ },
586
+ "VpcSNS5B664381": {
587
+ "Type": "AWS::EC2::VPCEndpoint",
588
+ "Properties": {
589
+ "PrivateDnsEnabled": true,
590
+ "SecurityGroupIds": [
591
+ {
592
+ "Fn::GetAtt": [
593
+ "lamsnsdeployFunctionWithVpcSNSsecuritygroup072F337C",
594
+ "GroupId"
595
+ ]
596
+ }
597
+ ],
598
+ "ServiceName": {
599
+ "Fn::Join": [
600
+ "",
601
+ [
602
+ "com.amazonaws.",
603
+ {
604
+ "Ref": "AWS::Region"
605
+ },
606
+ ".sns"
607
+ ]
608
+ ]
609
+ },
610
+ "SubnetIds": [
611
+ {
612
+ "Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
613
+ },
614
+ {
615
+ "Ref": "VpcisolatedSubnet2Subnet39217055"
616
+ }
617
+ ],
618
+ "VpcEndpointType": "Interface",
619
+ "VpcId": {
620
+ "Ref": "Vpc8378EB38"
621
+ }
622
+ }
623
+ },
624
+ "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0": {
625
+ "Type": "AWS::IAM::Role",
626
+ "Properties": {
627
+ "AssumeRolePolicyDocument": {
628
+ "Version": "2012-10-17",
629
+ "Statement": [
630
+ {
631
+ "Action": "sts:AssumeRole",
632
+ "Effect": "Allow",
633
+ "Principal": {
634
+ "Service": "lambda.amazonaws.com"
635
+ }
636
+ }
637
+ ]
638
+ },
639
+ "ManagedPolicyArns": [
640
+ {
641
+ "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
642
+ }
643
+ ],
644
+ "Policies": [
645
+ {
646
+ "PolicyName": "Inline",
647
+ "PolicyDocument": {
648
+ "Version": "2012-10-17",
649
+ "Statement": [
650
+ {
651
+ "Effect": "Allow",
652
+ "Action": [
653
+ "ec2:AuthorizeSecurityGroupIngress",
654
+ "ec2:AuthorizeSecurityGroupEgress",
655
+ "ec2:RevokeSecurityGroupIngress",
656
+ "ec2:RevokeSecurityGroupEgress"
657
+ ],
658
+ "Resource": [
659
+ {
660
+ "Fn::Join": [
661
+ "",
662
+ [
663
+ "arn:",
664
+ {
665
+ "Ref": "AWS::Partition"
666
+ },
667
+ ":ec2:",
668
+ {
669
+ "Ref": "AWS::Region"
670
+ },
671
+ ":",
672
+ {
673
+ "Ref": "AWS::AccountId"
674
+ },
675
+ ":security-group/",
676
+ {
677
+ "Fn::GetAtt": [
678
+ "Vpc8378EB38",
679
+ "DefaultSecurityGroup"
680
+ ]
681
+ }
682
+ ]
683
+ ]
684
+ }
685
+ ]
686
+ }
687
+ ]
688
+ }
689
+ }
690
+ ]
691
+ }
692
+ },
693
+ "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E": {
694
+ "Type": "AWS::Lambda::Function",
695
+ "Properties": {
696
+ "Code": {
697
+ "S3Bucket": {
698
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
699
+ },
700
+ "S3Key": "dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e.zip"
701
+ },
702
+ "Timeout": 900,
703
+ "MemorySize": 128,
704
+ "Handler": "__entrypoint__.handler",
705
+ "Role": {
706
+ "Fn::GetAtt": [
707
+ "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0",
708
+ "Arn"
709
+ ]
710
+ },
711
+ "Runtime": "nodejs18.x",
712
+ "Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group"
713
+ },
714
+ "DependsOn": [
715
+ "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0"
716
+ ],
717
+ "Metadata": {
718
+ "cfn_nag": {
719
+ "rules_to_suppress": [
720
+ {
721
+ "id": "W58",
722
+ "reason": "CDK generated custom resource"
723
+ },
724
+ {
725
+ "id": "W89",
726
+ "reason": "CDK generated custom resource"
727
+ },
728
+ {
729
+ "id": "W92",
730
+ "reason": "CDK generated custom resource"
731
+ }
732
+ ]
733
+ }
734
+ }
735
+ },
736
+ "lamsnsdeployFunctionWithVpcSNSsecuritygroup072F337C": {
737
+ "Type": "AWS::EC2::SecurityGroup",
738
+ "Properties": {
739
+ "GroupDescription": "lamsns-deployFunctionWithVpc/lamsns-deployFunctionWithVpc-SNS-security-group",
740
+ "SecurityGroupEgress": [
741
+ {
742
+ "CidrIp": "0.0.0.0/0",
743
+ "Description": "Allow all outbound traffic by default",
744
+ "IpProtocol": "-1"
745
+ }
746
+ ],
747
+ "SecurityGroupIngress": [
748
+ {
749
+ "CidrIp": {
750
+ "Fn::GetAtt": [
751
+ "Vpc8378EB38",
752
+ "CidrBlock"
753
+ ]
754
+ },
755
+ "Description": {
756
+ "Fn::Join": [
757
+ "",
758
+ [
759
+ "from ",
760
+ {
761
+ "Fn::GetAtt": [
762
+ "Vpc8378EB38",
763
+ "CidrBlock"
764
+ ]
765
+ },
766
+ ":443"
767
+ ]
768
+ ]
769
+ },
770
+ "FromPort": 443,
771
+ "IpProtocol": "tcp",
772
+ "ToPort": 443
773
+ }
774
+ ],
775
+ "VpcId": {
776
+ "Ref": "Vpc8378EB38"
777
+ }
778
+ },
779
+ "Metadata": {
780
+ "cfn_nag": {
781
+ "rules_to_suppress": [
782
+ {
783
+ "id": "W5",
784
+ "reason": "Egress of 0.0.0.0/0 is default and generally considered OK"
785
+ },
786
+ {
787
+ "id": "W40",
788
+ "reason": "Egress IPProtocol of -1 is default and generally considered OK"
789
+ }
790
+ ]
791
+ }
792
+ }
793
+ }
794
+ },
795
+ "Parameters": {
796
+ "BootstrapVersion": {
797
+ "Type": "AWS::SSM::Parameter::Value<String>",
798
+ "Default": "/cdk-bootstrap/hnb659fds/version",
799
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
800
+ }
801
+ },
802
+ "Rules": {
803
+ "CheckBootstrapVersion": {
804
+ "Assertions": [
805
+ {
806
+ "Assert": {
807
+ "Fn::Not": [
808
+ {
809
+ "Fn::Contains": [
810
+ [
811
+ "1",
812
+ "2",
813
+ "3",
814
+ "4",
815
+ "5"
816
+ ],
817
+ {
818
+ "Ref": "BootstrapVersion"
819
+ }
820
+ ]
821
+ }
822
+ ]
823
+ },
824
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
825
+ }
826
+ ]
827
+ }
828
+ }
829
+ }