@aws-solutions-constructs/aws-lambda-secretsmanager 2.51.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 (53) 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.lamsec-deployFunction.js +5 -2
  7. package/test/integ.lamsec-deployFunction.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  8. package/test/integ.lamsec-deployFunction.js.snapshot/cdk.out +1 -0
  9. package/test/integ.lamsec-deployFunction.js.snapshot/integ.json +12 -0
  10. package/test/integ.lamsec-deployFunction.js.snapshot/lamsec-deployFunction.assets.json +32 -0
  11. package/test/integ.lamsec-deployFunction.js.snapshot/lamsec-deployFunction.template.json +208 -0
  12. package/test/integ.lamsec-deployFunction.js.snapshot/lamsecdeployFunctionIntegDefaultTestDeployAssert7322BEEA.assets.json +19 -0
  13. package/test/integ.lamsec-deployFunction.js.snapshot/lamsecdeployFunctionIntegDefaultTestDeployAssert7322BEEA.template.json +36 -0
  14. package/test/integ.lamsec-deployFunction.js.snapshot/manifest.json +131 -0
  15. package/test/integ.lamsec-deployFunction.js.snapshot/tree.json +342 -0
  16. package/test/integ.lamsec-deployFunctionWithExistingVpc.js +6 -2
  17. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  18. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
  19. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
  20. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/cdk.out +1 -0
  21. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/integ.json +12 -0
  22. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsec-deployFunctionWithExistingVpc.assets.json +45 -0
  23. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsec-deployFunctionWithExistingVpc.template.json +1019 -0
  24. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsecdeployFunctionWithExistingVpcIntegDefaultTestDeployAssert647243A7.assets.json +19 -0
  25. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsecdeployFunctionWithExistingVpcIntegDefaultTestDeployAssert647243A7.template.json +36 -0
  26. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/manifest.json +329 -0
  27. package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/tree.json +1393 -0
  28. package/test/integ.lamsec-deployFunctionWithVpc.js +6 -2
  29. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  30. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
  31. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
  32. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/cdk.out +1 -0
  33. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/integ.json +12 -0
  34. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsec-deployFunctionWithVpc.assets.json +45 -0
  35. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsec-deployFunctionWithVpc.template.json +735 -0
  36. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsecdeployFunctionWithVpcIntegDefaultTestDeployAssert66148FF5.assets.json +19 -0
  37. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsecdeployFunctionWithVpcIntegDefaultTestDeployAssert66148FF5.template.json +36 -0
  38. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/manifest.json +233 -0
  39. package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/tree.json +981 -0
  40. package/test/integ.lamsec-existingFunction.js +5 -2
  41. package/test/integ.lamsec-existingFunction.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  42. package/test/integ.lamsec-existingFunction.js.snapshot/cdk.out +1 -0
  43. package/test/integ.lamsec-existingFunction.js.snapshot/integ.json +12 -0
  44. package/test/integ.lamsec-existingFunction.js.snapshot/lamsec-existingFunction.assets.json +32 -0
  45. package/test/integ.lamsec-existingFunction.js.snapshot/lamsec-existingFunction.template.json +208 -0
  46. package/test/integ.lamsec-existingFunction.js.snapshot/lamsecexistingFunctionIntegDefaultTestDeployAssert295B352B.assets.json +19 -0
  47. package/test/integ.lamsec-existingFunction.js.snapshot/lamsecexistingFunctionIntegDefaultTestDeployAssert295B352B.template.json +36 -0
  48. package/test/integ.lamsec-existingFunction.js.snapshot/manifest.json +131 -0
  49. package/test/integ.lamsec-existingFunction.js.snapshot/tree.json +342 -0
  50. package/test/integ.lamsec-deployFunction.expected.json +0 -208
  51. package/test/integ.lamsec-deployFunctionWithExistingVpc.expected.json +0 -1044
  52. package/test/integ.lamsec-deployFunctionWithVpc.expected.json +0 -650
  53. package/test/integ.lamsec-existingFunction.expected.json +0 -208
@@ -0,0 +1,735 @@
1
+ {
2
+ "Description": "Integration Test for aws-lambda-secretsmanager",
3
+ "Resources": {
4
+ "testlambdasecretsmanagerLambdaFunctionServiceRole92CE007F": {
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
+ "testlambdasecretsmanagerLambdaFunctionServiceRoleDefaultPolicyF24BF460": {
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": [
79
+ "secretsmanager:DescribeSecret",
80
+ "secretsmanager:GetSecretValue"
81
+ ],
82
+ "Effect": "Allow",
83
+ "Resource": {
84
+ "Ref": "testlambdasecretsmanagersecret4C99E6BF"
85
+ }
86
+ }
87
+ ],
88
+ "Version": "2012-10-17"
89
+ },
90
+ "PolicyName": "testlambdasecretsmanagerLambdaFunctionServiceRoleDefaultPolicyF24BF460",
91
+ "Roles": [
92
+ {
93
+ "Ref": "testlambdasecretsmanagerLambdaFunctionServiceRole92CE007F"
94
+ }
95
+ ]
96
+ },
97
+ "Metadata": {
98
+ "cfn_nag": {
99
+ "rules_to_suppress": [
100
+ {
101
+ "id": "W12",
102
+ "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
103
+ }
104
+ ]
105
+ }
106
+ }
107
+ },
108
+ "testlambdasecretsmanagerReplaceDefaultSecurityGroupsecuritygroupF837FD37": {
109
+ "Type": "AWS::EC2::SecurityGroup",
110
+ "Properties": {
111
+ "GroupDescription": "lamsec-deployFunctionWithVpc/test-lambda-secretsmanager/ReplaceDefaultSecurityGroup-security-group",
112
+ "SecurityGroupEgress": [
113
+ {
114
+ "CidrIp": "0.0.0.0/0",
115
+ "Description": "Allow all outbound traffic by default",
116
+ "IpProtocol": "-1"
117
+ }
118
+ ],
119
+ "VpcId": {
120
+ "Ref": "Vpc8378EB38"
121
+ }
122
+ },
123
+ "Metadata": {
124
+ "cfn_nag": {
125
+ "rules_to_suppress": [
126
+ {
127
+ "id": "W5",
128
+ "reason": "Egress of 0.0.0.0/0 is default and generally considered OK"
129
+ },
130
+ {
131
+ "id": "W40",
132
+ "reason": "Egress IPProtocol of -1 is default and generally considered OK"
133
+ }
134
+ ]
135
+ }
136
+ }
137
+ },
138
+ "testlambdasecretsmanagerLambdaFunction130E7301": {
139
+ "Type": "AWS::Lambda::Function",
140
+ "Properties": {
141
+ "Code": {
142
+ "S3Bucket": {
143
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
144
+ },
145
+ "S3Key": "0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8.zip"
146
+ },
147
+ "Environment": {
148
+ "Variables": {
149
+ "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
150
+ "SECRET_ARN": {
151
+ "Ref": "testlambdasecretsmanagersecret4C99E6BF"
152
+ }
153
+ }
154
+ },
155
+ "Handler": "index.handler",
156
+ "Role": {
157
+ "Fn::GetAtt": [
158
+ "testlambdasecretsmanagerLambdaFunctionServiceRole92CE007F",
159
+ "Arn"
160
+ ]
161
+ },
162
+ "Runtime": "nodejs16.x",
163
+ "TracingConfig": {
164
+ "Mode": "Active"
165
+ },
166
+ "VpcConfig": {
167
+ "SecurityGroupIds": [
168
+ {
169
+ "Fn::GetAtt": [
170
+ "testlambdasecretsmanagerReplaceDefaultSecurityGroupsecuritygroupF837FD37",
171
+ "GroupId"
172
+ ]
173
+ }
174
+ ],
175
+ "SubnetIds": [
176
+ {
177
+ "Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
178
+ },
179
+ {
180
+ "Ref": "VpcisolatedSubnet2Subnet39217055"
181
+ }
182
+ ]
183
+ }
184
+ },
185
+ "DependsOn": [
186
+ "testlambdasecretsmanagerLambdaFunctionServiceRoleDefaultPolicyF24BF460",
187
+ "testlambdasecretsmanagerLambdaFunctionServiceRole92CE007F",
188
+ "VpcisolatedSubnet1RouteTableAssociationD259E31A",
189
+ "VpcisolatedSubnet2RouteTableAssociation25A4716F"
190
+ ],
191
+ "Metadata": {
192
+ "cfn_nag": {
193
+ "rules_to_suppress": [
194
+ {
195
+ "id": "W58",
196
+ "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."
197
+ },
198
+ {
199
+ "id": "W89",
200
+ "reason": "This is not a rule for the general case, just for specific use cases/industries"
201
+ },
202
+ {
203
+ "id": "W92",
204
+ "reason": "Impossible for us to define the correct concurrency for clients"
205
+ }
206
+ ]
207
+ }
208
+ }
209
+ },
210
+ "testlambdasecretsmanagersecret4C99E6BF": {
211
+ "Type": "AWS::SecretsManager::Secret",
212
+ "Properties": {
213
+ "GenerateSecretString": {}
214
+ },
215
+ "UpdateReplacePolicy": "Delete",
216
+ "DeletionPolicy": "Delete",
217
+ "Metadata": {
218
+ "cfn_nag": {
219
+ "rules_to_suppress": [
220
+ {
221
+ "id": "W77",
222
+ "reason": "We allow the use of the AWS account default key aws/secretsmanager for secret encryption."
223
+ }
224
+ ]
225
+ }
226
+ }
227
+ },
228
+ "Vpc8378EB38": {
229
+ "Type": "AWS::EC2::VPC",
230
+ "Properties": {
231
+ "CidrBlock": "10.0.0.0/16",
232
+ "EnableDnsHostnames": true,
233
+ "EnableDnsSupport": true,
234
+ "InstanceTenancy": "default",
235
+ "Tags": [
236
+ {
237
+ "Key": "Name",
238
+ "Value": "lamsec-deployFunctionWithVpc/Vpc"
239
+ }
240
+ ]
241
+ }
242
+ },
243
+ "VpcisolatedSubnet1SubnetE62B1B9B": {
244
+ "Type": "AWS::EC2::Subnet",
245
+ "Properties": {
246
+ "AvailabilityZone": {
247
+ "Fn::Select": [
248
+ 0,
249
+ {
250
+ "Fn::GetAZs": ""
251
+ }
252
+ ]
253
+ },
254
+ "CidrBlock": "10.0.0.0/18",
255
+ "MapPublicIpOnLaunch": false,
256
+ "Tags": [
257
+ {
258
+ "Key": "aws-cdk:subnet-name",
259
+ "Value": "isolated"
260
+ },
261
+ {
262
+ "Key": "aws-cdk:subnet-type",
263
+ "Value": "Isolated"
264
+ },
265
+ {
266
+ "Key": "Name",
267
+ "Value": "lamsec-deployFunctionWithVpc/Vpc/isolatedSubnet1"
268
+ }
269
+ ],
270
+ "VpcId": {
271
+ "Ref": "Vpc8378EB38"
272
+ }
273
+ }
274
+ },
275
+ "VpcisolatedSubnet1RouteTableE442650B": {
276
+ "Type": "AWS::EC2::RouteTable",
277
+ "Properties": {
278
+ "Tags": [
279
+ {
280
+ "Key": "Name",
281
+ "Value": "lamsec-deployFunctionWithVpc/Vpc/isolatedSubnet1"
282
+ }
283
+ ],
284
+ "VpcId": {
285
+ "Ref": "Vpc8378EB38"
286
+ }
287
+ }
288
+ },
289
+ "VpcisolatedSubnet1RouteTableAssociationD259E31A": {
290
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
291
+ "Properties": {
292
+ "RouteTableId": {
293
+ "Ref": "VpcisolatedSubnet1RouteTableE442650B"
294
+ },
295
+ "SubnetId": {
296
+ "Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
297
+ }
298
+ }
299
+ },
300
+ "VpcisolatedSubnet2Subnet39217055": {
301
+ "Type": "AWS::EC2::Subnet",
302
+ "Properties": {
303
+ "AvailabilityZone": {
304
+ "Fn::Select": [
305
+ 1,
306
+ {
307
+ "Fn::GetAZs": ""
308
+ }
309
+ ]
310
+ },
311
+ "CidrBlock": "10.0.64.0/18",
312
+ "MapPublicIpOnLaunch": false,
313
+ "Tags": [
314
+ {
315
+ "Key": "aws-cdk:subnet-name",
316
+ "Value": "isolated"
317
+ },
318
+ {
319
+ "Key": "aws-cdk:subnet-type",
320
+ "Value": "Isolated"
321
+ },
322
+ {
323
+ "Key": "Name",
324
+ "Value": "lamsec-deployFunctionWithVpc/Vpc/isolatedSubnet2"
325
+ }
326
+ ],
327
+ "VpcId": {
328
+ "Ref": "Vpc8378EB38"
329
+ }
330
+ }
331
+ },
332
+ "VpcisolatedSubnet2RouteTable334F9764": {
333
+ "Type": "AWS::EC2::RouteTable",
334
+ "Properties": {
335
+ "Tags": [
336
+ {
337
+ "Key": "Name",
338
+ "Value": "lamsec-deployFunctionWithVpc/Vpc/isolatedSubnet2"
339
+ }
340
+ ],
341
+ "VpcId": {
342
+ "Ref": "Vpc8378EB38"
343
+ }
344
+ }
345
+ },
346
+ "VpcisolatedSubnet2RouteTableAssociation25A4716F": {
347
+ "Type": "AWS::EC2::SubnetRouteTableAssociation",
348
+ "Properties": {
349
+ "RouteTableId": {
350
+ "Ref": "VpcisolatedSubnet2RouteTable334F9764"
351
+ },
352
+ "SubnetId": {
353
+ "Ref": "VpcisolatedSubnet2Subnet39217055"
354
+ }
355
+ }
356
+ },
357
+ "VpcRestrictDefaultSecurityGroupCustomResourceC73DA2BE": {
358
+ "Type": "Custom::VpcRestrictDefaultSG",
359
+ "Properties": {
360
+ "ServiceToken": {
361
+ "Fn::GetAtt": [
362
+ "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E",
363
+ "Arn"
364
+ ]
365
+ },
366
+ "DefaultSecurityGroupId": {
367
+ "Fn::GetAtt": [
368
+ "Vpc8378EB38",
369
+ "DefaultSecurityGroup"
370
+ ]
371
+ },
372
+ "Account": {
373
+ "Ref": "AWS::AccountId"
374
+ }
375
+ },
376
+ "UpdateReplacePolicy": "Delete",
377
+ "DeletionPolicy": "Delete"
378
+ },
379
+ "VpcFlowLogIAMRole6A475D41": {
380
+ "Type": "AWS::IAM::Role",
381
+ "Properties": {
382
+ "AssumeRolePolicyDocument": {
383
+ "Statement": [
384
+ {
385
+ "Action": "sts:AssumeRole",
386
+ "Effect": "Allow",
387
+ "Principal": {
388
+ "Service": "vpc-flow-logs.amazonaws.com"
389
+ }
390
+ }
391
+ ],
392
+ "Version": "2012-10-17"
393
+ },
394
+ "Tags": [
395
+ {
396
+ "Key": "Name",
397
+ "Value": "lamsec-deployFunctionWithVpc/Vpc/FlowLog"
398
+ }
399
+ ]
400
+ }
401
+ },
402
+ "VpcFlowLogIAMRoleDefaultPolicy406FB995": {
403
+ "Type": "AWS::IAM::Policy",
404
+ "Properties": {
405
+ "PolicyDocument": {
406
+ "Statement": [
407
+ {
408
+ "Action": [
409
+ "logs:CreateLogStream",
410
+ "logs:DescribeLogStreams",
411
+ "logs:PutLogEvents"
412
+ ],
413
+ "Effect": "Allow",
414
+ "Resource": {
415
+ "Fn::GetAtt": [
416
+ "VpcFlowLogLogGroup7B5C56B9",
417
+ "Arn"
418
+ ]
419
+ }
420
+ },
421
+ {
422
+ "Action": "iam:PassRole",
423
+ "Effect": "Allow",
424
+ "Resource": {
425
+ "Fn::GetAtt": [
426
+ "VpcFlowLogIAMRole6A475D41",
427
+ "Arn"
428
+ ]
429
+ }
430
+ }
431
+ ],
432
+ "Version": "2012-10-17"
433
+ },
434
+ "PolicyName": "VpcFlowLogIAMRoleDefaultPolicy406FB995",
435
+ "Roles": [
436
+ {
437
+ "Ref": "VpcFlowLogIAMRole6A475D41"
438
+ }
439
+ ]
440
+ }
441
+ },
442
+ "VpcFlowLogLogGroup7B5C56B9": {
443
+ "Type": "AWS::Logs::LogGroup",
444
+ "Properties": {
445
+ "RetentionInDays": 731,
446
+ "Tags": [
447
+ {
448
+ "Key": "Name",
449
+ "Value": "lamsec-deployFunctionWithVpc/Vpc/FlowLog"
450
+ }
451
+ ]
452
+ },
453
+ "UpdateReplacePolicy": "Retain",
454
+ "DeletionPolicy": "Retain",
455
+ "Metadata": {
456
+ "cfn_nag": {
457
+ "rules_to_suppress": [
458
+ {
459
+ "id": "W84",
460
+ "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
461
+ }
462
+ ]
463
+ }
464
+ }
465
+ },
466
+ "VpcFlowLog8FF33A73": {
467
+ "Type": "AWS::EC2::FlowLog",
468
+ "Properties": {
469
+ "DeliverLogsPermissionArn": {
470
+ "Fn::GetAtt": [
471
+ "VpcFlowLogIAMRole6A475D41",
472
+ "Arn"
473
+ ]
474
+ },
475
+ "LogDestinationType": "cloud-watch-logs",
476
+ "LogGroupName": {
477
+ "Ref": "VpcFlowLogLogGroup7B5C56B9"
478
+ },
479
+ "ResourceId": {
480
+ "Ref": "Vpc8378EB38"
481
+ },
482
+ "ResourceType": "VPC",
483
+ "Tags": [
484
+ {
485
+ "Key": "Name",
486
+ "Value": "lamsec-deployFunctionWithVpc/Vpc/FlowLog"
487
+ }
488
+ ],
489
+ "TrafficType": "ALL"
490
+ }
491
+ },
492
+ "VpcSECRETSMANAGERF52907C2": {
493
+ "Type": "AWS::EC2::VPCEndpoint",
494
+ "Properties": {
495
+ "PrivateDnsEnabled": true,
496
+ "SecurityGroupIds": [
497
+ {
498
+ "Fn::GetAtt": [
499
+ "lamsecdeployFunctionWithVpcSECRETSMANAGERsecuritygroup98862008",
500
+ "GroupId"
501
+ ]
502
+ }
503
+ ],
504
+ "ServiceName": {
505
+ "Fn::Join": [
506
+ "",
507
+ [
508
+ "com.amazonaws.",
509
+ {
510
+ "Ref": "AWS::Region"
511
+ },
512
+ ".secretsmanager"
513
+ ]
514
+ ]
515
+ },
516
+ "SubnetIds": [
517
+ {
518
+ "Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
519
+ },
520
+ {
521
+ "Ref": "VpcisolatedSubnet2Subnet39217055"
522
+ }
523
+ ],
524
+ "VpcEndpointType": "Interface",
525
+ "VpcId": {
526
+ "Ref": "Vpc8378EB38"
527
+ }
528
+ }
529
+ },
530
+ "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0": {
531
+ "Type": "AWS::IAM::Role",
532
+ "Properties": {
533
+ "AssumeRolePolicyDocument": {
534
+ "Version": "2012-10-17",
535
+ "Statement": [
536
+ {
537
+ "Action": "sts:AssumeRole",
538
+ "Effect": "Allow",
539
+ "Principal": {
540
+ "Service": "lambda.amazonaws.com"
541
+ }
542
+ }
543
+ ]
544
+ },
545
+ "ManagedPolicyArns": [
546
+ {
547
+ "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
548
+ }
549
+ ],
550
+ "Policies": [
551
+ {
552
+ "PolicyName": "Inline",
553
+ "PolicyDocument": {
554
+ "Version": "2012-10-17",
555
+ "Statement": [
556
+ {
557
+ "Effect": "Allow",
558
+ "Action": [
559
+ "ec2:AuthorizeSecurityGroupIngress",
560
+ "ec2:AuthorizeSecurityGroupEgress",
561
+ "ec2:RevokeSecurityGroupIngress",
562
+ "ec2:RevokeSecurityGroupEgress"
563
+ ],
564
+ "Resource": [
565
+ {
566
+ "Fn::Join": [
567
+ "",
568
+ [
569
+ "arn:",
570
+ {
571
+ "Ref": "AWS::Partition"
572
+ },
573
+ ":ec2:",
574
+ {
575
+ "Ref": "AWS::Region"
576
+ },
577
+ ":",
578
+ {
579
+ "Ref": "AWS::AccountId"
580
+ },
581
+ ":security-group/",
582
+ {
583
+ "Fn::GetAtt": [
584
+ "Vpc8378EB38",
585
+ "DefaultSecurityGroup"
586
+ ]
587
+ }
588
+ ]
589
+ ]
590
+ }
591
+ ]
592
+ }
593
+ ]
594
+ }
595
+ }
596
+ ]
597
+ }
598
+ },
599
+ "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E": {
600
+ "Type": "AWS::Lambda::Function",
601
+ "Properties": {
602
+ "Code": {
603
+ "S3Bucket": {
604
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
605
+ },
606
+ "S3Key": "dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e.zip"
607
+ },
608
+ "Timeout": 900,
609
+ "MemorySize": 128,
610
+ "Handler": "__entrypoint__.handler",
611
+ "Role": {
612
+ "Fn::GetAtt": [
613
+ "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0",
614
+ "Arn"
615
+ ]
616
+ },
617
+ "Runtime": "nodejs18.x",
618
+ "Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group"
619
+ },
620
+ "DependsOn": [
621
+ "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0"
622
+ ],
623
+ "Metadata": {
624
+ "cfn_nag": {
625
+ "rules_to_suppress": [
626
+ {
627
+ "id": "W58",
628
+ "reason": "CDK generated custom resource"
629
+ },
630
+ {
631
+ "id": "W89",
632
+ "reason": "CDK generated custom resource"
633
+ },
634
+ {
635
+ "id": "W92",
636
+ "reason": "CDK generated custom resource"
637
+ }
638
+ ]
639
+ }
640
+ }
641
+ },
642
+ "lamsecdeployFunctionWithVpcSECRETSMANAGERsecuritygroup98862008": {
643
+ "Type": "AWS::EC2::SecurityGroup",
644
+ "Properties": {
645
+ "GroupDescription": "lamsec-deployFunctionWithVpc/lamsec-deployFunctionWithVpc-SECRETS_MANAGER-security-group",
646
+ "SecurityGroupEgress": [
647
+ {
648
+ "CidrIp": "0.0.0.0/0",
649
+ "Description": "Allow all outbound traffic by default",
650
+ "IpProtocol": "-1"
651
+ }
652
+ ],
653
+ "SecurityGroupIngress": [
654
+ {
655
+ "CidrIp": {
656
+ "Fn::GetAtt": [
657
+ "Vpc8378EB38",
658
+ "CidrBlock"
659
+ ]
660
+ },
661
+ "Description": {
662
+ "Fn::Join": [
663
+ "",
664
+ [
665
+ "from ",
666
+ {
667
+ "Fn::GetAtt": [
668
+ "Vpc8378EB38",
669
+ "CidrBlock"
670
+ ]
671
+ },
672
+ ":443"
673
+ ]
674
+ ]
675
+ },
676
+ "FromPort": 443,
677
+ "IpProtocol": "tcp",
678
+ "ToPort": 443
679
+ }
680
+ ],
681
+ "VpcId": {
682
+ "Ref": "Vpc8378EB38"
683
+ }
684
+ },
685
+ "Metadata": {
686
+ "cfn_nag": {
687
+ "rules_to_suppress": [
688
+ {
689
+ "id": "W5",
690
+ "reason": "Egress of 0.0.0.0/0 is default and generally considered OK"
691
+ },
692
+ {
693
+ "id": "W40",
694
+ "reason": "Egress IPProtocol of -1 is default and generally considered OK"
695
+ }
696
+ ]
697
+ }
698
+ }
699
+ }
700
+ },
701
+ "Parameters": {
702
+ "BootstrapVersion": {
703
+ "Type": "AWS::SSM::Parameter::Value<String>",
704
+ "Default": "/cdk-bootstrap/hnb659fds/version",
705
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
706
+ }
707
+ },
708
+ "Rules": {
709
+ "CheckBootstrapVersion": {
710
+ "Assertions": [
711
+ {
712
+ "Assert": {
713
+ "Fn::Not": [
714
+ {
715
+ "Fn::Contains": [
716
+ [
717
+ "1",
718
+ "2",
719
+ "3",
720
+ "4",
721
+ "5"
722
+ ],
723
+ {
724
+ "Ref": "BootstrapVersion"
725
+ }
726
+ ]
727
+ }
728
+ ]
729
+ },
730
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
731
+ }
732
+ ]
733
+ }
734
+ }
735
+ }