@aws-solutions-constructs/aws-lambda-secretsmanager 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.
- package/.eslintignore +2 -0
- package/.jsii +49 -4
- package/integ.config.json +7 -0
- package/lib/index.js +1 -1
- package/package.json +9 -8
- package/test/integ.lamsec-deployFunction.js +5 -2
- package/test/integ.lamsec-deployFunction.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/cdk.out +1 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/integ.json +12 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/lamsec-deployFunction.assets.json +32 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/lamsec-deployFunction.template.json +208 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/lamsecdeployFunctionIntegDefaultTestDeployAssert7322BEEA.assets.json +19 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/lamsecdeployFunctionIntegDefaultTestDeployAssert7322BEEA.template.json +36 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/manifest.json +131 -0
- package/test/integ.lamsec-deployFunction.js.snapshot/tree.json +342 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js +6 -2
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/cdk.out +1 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/integ.json +12 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsec-deployFunctionWithExistingVpc.assets.json +45 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsec-deployFunctionWithExistingVpc.template.json +1019 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsecdeployFunctionWithExistingVpcIntegDefaultTestDeployAssert647243A7.assets.json +19 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsecdeployFunctionWithExistingVpcIntegDefaultTestDeployAssert647243A7.template.json +36 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/manifest.json +329 -0
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/tree.json +1393 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js +6 -2
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/cdk.out +1 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/integ.json +12 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsec-deployFunctionWithVpc.assets.json +45 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsec-deployFunctionWithVpc.template.json +735 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsecdeployFunctionWithVpcIntegDefaultTestDeployAssert66148FF5.assets.json +19 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsecdeployFunctionWithVpcIntegDefaultTestDeployAssert66148FF5.template.json +36 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/manifest.json +233 -0
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/tree.json +981 -0
- package/test/integ.lamsec-existingFunction.js +5 -2
- package/test/integ.lamsec-existingFunction.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/cdk.out +1 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/integ.json +12 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/lamsec-existingFunction.assets.json +32 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/lamsec-existingFunction.template.json +208 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/lamsecexistingFunctionIntegDefaultTestDeployAssert295B352B.assets.json +19 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/lamsecexistingFunctionIntegDefaultTestDeployAssert295B352B.template.json +36 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/manifest.json +131 -0
- package/test/integ.lamsec-existingFunction.js.snapshot/tree.json +342 -0
- package/test/integ.lamsec-deployFunction.expected.json +0 -208
- package/test/integ.lamsec-deployFunctionWithExistingVpc.expected.json +0 -1044
- package/test/integ.lamsec-deployFunctionWithVpc.expected.json +0 -650
- package/test/integ.lamsec-existingFunction.expected.json +0 -208
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "tree-0.1",
|
|
3
|
+
"tree": {
|
|
4
|
+
"id": "App",
|
|
5
|
+
"path": "",
|
|
6
|
+
"children": {
|
|
7
|
+
"lamsec-deployFunction": {
|
|
8
|
+
"id": "lamsec-deployFunction",
|
|
9
|
+
"path": "lamsec-deployFunction",
|
|
10
|
+
"children": {
|
|
11
|
+
"test-lambda-secretsmanager": {
|
|
12
|
+
"id": "test-lambda-secretsmanager",
|
|
13
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager",
|
|
14
|
+
"children": {
|
|
15
|
+
"LambdaFunctionServiceRole": {
|
|
16
|
+
"id": "LambdaFunctionServiceRole",
|
|
17
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunctionServiceRole",
|
|
18
|
+
"children": {
|
|
19
|
+
"ImportLambdaFunctionServiceRole": {
|
|
20
|
+
"id": "ImportLambdaFunctionServiceRole",
|
|
21
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole",
|
|
22
|
+
"constructInfo": {
|
|
23
|
+
"fqn": "aws-cdk-lib.Resource",
|
|
24
|
+
"version": "2.118.0"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"Resource": {
|
|
28
|
+
"id": "Resource",
|
|
29
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunctionServiceRole/Resource",
|
|
30
|
+
"attributes": {
|
|
31
|
+
"aws:cdk:cloudformation:type": "AWS::IAM::Role",
|
|
32
|
+
"aws:cdk:cloudformation:props": {
|
|
33
|
+
"assumeRolePolicyDocument": {
|
|
34
|
+
"Statement": [
|
|
35
|
+
{
|
|
36
|
+
"Action": "sts:AssumeRole",
|
|
37
|
+
"Effect": "Allow",
|
|
38
|
+
"Principal": {
|
|
39
|
+
"Service": "lambda.amazonaws.com"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"Version": "2012-10-17"
|
|
44
|
+
},
|
|
45
|
+
"policies": [
|
|
46
|
+
{
|
|
47
|
+
"policyName": "LambdaFunctionServiceRolePolicy",
|
|
48
|
+
"policyDocument": {
|
|
49
|
+
"Statement": [
|
|
50
|
+
{
|
|
51
|
+
"Action": [
|
|
52
|
+
"logs:CreateLogGroup",
|
|
53
|
+
"logs:CreateLogStream",
|
|
54
|
+
"logs:PutLogEvents"
|
|
55
|
+
],
|
|
56
|
+
"Effect": "Allow",
|
|
57
|
+
"Resource": {
|
|
58
|
+
"Fn::Join": [
|
|
59
|
+
"",
|
|
60
|
+
[
|
|
61
|
+
"arn:",
|
|
62
|
+
{
|
|
63
|
+
"Ref": "AWS::Partition"
|
|
64
|
+
},
|
|
65
|
+
":logs:",
|
|
66
|
+
{
|
|
67
|
+
"Ref": "AWS::Region"
|
|
68
|
+
},
|
|
69
|
+
":",
|
|
70
|
+
{
|
|
71
|
+
"Ref": "AWS::AccountId"
|
|
72
|
+
},
|
|
73
|
+
":log-group:/aws/lambda/*"
|
|
74
|
+
]
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"Version": "2012-10-17"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"constructInfo": {
|
|
86
|
+
"fqn": "aws-cdk-lib.aws_iam.CfnRole",
|
|
87
|
+
"version": "2.118.0"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"DefaultPolicy": {
|
|
91
|
+
"id": "DefaultPolicy",
|
|
92
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunctionServiceRole/DefaultPolicy",
|
|
93
|
+
"children": {
|
|
94
|
+
"Resource": {
|
|
95
|
+
"id": "Resource",
|
|
96
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunctionServiceRole/DefaultPolicy/Resource",
|
|
97
|
+
"attributes": {
|
|
98
|
+
"aws:cdk:cloudformation:type": "AWS::IAM::Policy",
|
|
99
|
+
"aws:cdk:cloudformation:props": {
|
|
100
|
+
"policyDocument": {
|
|
101
|
+
"Statement": [
|
|
102
|
+
{
|
|
103
|
+
"Action": [
|
|
104
|
+
"xray:PutTelemetryRecords",
|
|
105
|
+
"xray:PutTraceSegments"
|
|
106
|
+
],
|
|
107
|
+
"Effect": "Allow",
|
|
108
|
+
"Resource": "*"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"Action": [
|
|
112
|
+
"secretsmanager:DescribeSecret",
|
|
113
|
+
"secretsmanager:GetSecretValue"
|
|
114
|
+
],
|
|
115
|
+
"Effect": "Allow",
|
|
116
|
+
"Resource": {
|
|
117
|
+
"Ref": "testlambdasecretsmanagersecret4C99E6BF"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"Version": "2012-10-17"
|
|
122
|
+
},
|
|
123
|
+
"policyName": "testlambdasecretsmanagerLambdaFunctionServiceRoleDefaultPolicyF24BF460",
|
|
124
|
+
"roles": [
|
|
125
|
+
{
|
|
126
|
+
"Ref": "testlambdasecretsmanagerLambdaFunctionServiceRole92CE007F"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"constructInfo": {
|
|
132
|
+
"fqn": "aws-cdk-lib.aws_iam.CfnPolicy",
|
|
133
|
+
"version": "2.118.0"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"constructInfo": {
|
|
138
|
+
"fqn": "aws-cdk-lib.aws_iam.Policy",
|
|
139
|
+
"version": "2.118.0"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"constructInfo": {
|
|
144
|
+
"fqn": "aws-cdk-lib.aws_iam.Role",
|
|
145
|
+
"version": "2.118.0"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"LambdaFunction": {
|
|
149
|
+
"id": "LambdaFunction",
|
|
150
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunction",
|
|
151
|
+
"children": {
|
|
152
|
+
"Code": {
|
|
153
|
+
"id": "Code",
|
|
154
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunction/Code",
|
|
155
|
+
"children": {
|
|
156
|
+
"Stage": {
|
|
157
|
+
"id": "Stage",
|
|
158
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunction/Code/Stage",
|
|
159
|
+
"constructInfo": {
|
|
160
|
+
"fqn": "aws-cdk-lib.AssetStaging",
|
|
161
|
+
"version": "2.118.0"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"AssetBucket": {
|
|
165
|
+
"id": "AssetBucket",
|
|
166
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunction/Code/AssetBucket",
|
|
167
|
+
"constructInfo": {
|
|
168
|
+
"fqn": "aws-cdk-lib.aws_s3.BucketBase",
|
|
169
|
+
"version": "2.118.0"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"constructInfo": {
|
|
174
|
+
"fqn": "aws-cdk-lib.aws_s3_assets.Asset",
|
|
175
|
+
"version": "2.118.0"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"Resource": {
|
|
179
|
+
"id": "Resource",
|
|
180
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/LambdaFunction/Resource",
|
|
181
|
+
"attributes": {
|
|
182
|
+
"aws:cdk:cloudformation:type": "AWS::Lambda::Function",
|
|
183
|
+
"aws:cdk:cloudformation:props": {
|
|
184
|
+
"code": {
|
|
185
|
+
"s3Bucket": {
|
|
186
|
+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
|
|
187
|
+
},
|
|
188
|
+
"s3Key": "0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8.zip"
|
|
189
|
+
},
|
|
190
|
+
"environment": {
|
|
191
|
+
"variables": {
|
|
192
|
+
"AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
|
|
193
|
+
"SECRET_ARN": {
|
|
194
|
+
"Ref": "testlambdasecretsmanagersecret4C99E6BF"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"handler": "index.handler",
|
|
199
|
+
"role": {
|
|
200
|
+
"Fn::GetAtt": [
|
|
201
|
+
"testlambdasecretsmanagerLambdaFunctionServiceRole92CE007F",
|
|
202
|
+
"Arn"
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
"runtime": "nodejs16.x",
|
|
206
|
+
"tracingConfig": {
|
|
207
|
+
"mode": "Active"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"constructInfo": {
|
|
212
|
+
"fqn": "aws-cdk-lib.aws_lambda.CfnFunction",
|
|
213
|
+
"version": "2.118.0"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"constructInfo": {
|
|
218
|
+
"fqn": "aws-cdk-lib.aws_lambda.Function",
|
|
219
|
+
"version": "2.118.0"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"secret": {
|
|
223
|
+
"id": "secret",
|
|
224
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/secret",
|
|
225
|
+
"children": {
|
|
226
|
+
"Resource": {
|
|
227
|
+
"id": "Resource",
|
|
228
|
+
"path": "lamsec-deployFunction/test-lambda-secretsmanager/secret/Resource",
|
|
229
|
+
"attributes": {
|
|
230
|
+
"aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret",
|
|
231
|
+
"aws:cdk:cloudformation:props": {
|
|
232
|
+
"generateSecretString": {}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"constructInfo": {
|
|
236
|
+
"fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecret",
|
|
237
|
+
"version": "2.118.0"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"constructInfo": {
|
|
242
|
+
"fqn": "aws-cdk-lib.aws_secretsmanager.Secret",
|
|
243
|
+
"version": "2.118.0"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"constructInfo": {
|
|
248
|
+
"fqn": "@aws-solutions-constructs/aws-lambda-secretsmanager.LambdaToSecretsmanager",
|
|
249
|
+
"version": "2.50.0"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"Integ": {
|
|
253
|
+
"id": "Integ",
|
|
254
|
+
"path": "lamsec-deployFunction/Integ",
|
|
255
|
+
"children": {
|
|
256
|
+
"DefaultTest": {
|
|
257
|
+
"id": "DefaultTest",
|
|
258
|
+
"path": "lamsec-deployFunction/Integ/DefaultTest",
|
|
259
|
+
"children": {
|
|
260
|
+
"Default": {
|
|
261
|
+
"id": "Default",
|
|
262
|
+
"path": "lamsec-deployFunction/Integ/DefaultTest/Default",
|
|
263
|
+
"constructInfo": {
|
|
264
|
+
"fqn": "constructs.Construct",
|
|
265
|
+
"version": "10.0.0"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"DeployAssert": {
|
|
269
|
+
"id": "DeployAssert",
|
|
270
|
+
"path": "lamsec-deployFunction/Integ/DefaultTest/DeployAssert",
|
|
271
|
+
"children": {
|
|
272
|
+
"BootstrapVersion": {
|
|
273
|
+
"id": "BootstrapVersion",
|
|
274
|
+
"path": "lamsec-deployFunction/Integ/DefaultTest/DeployAssert/BootstrapVersion",
|
|
275
|
+
"constructInfo": {
|
|
276
|
+
"fqn": "aws-cdk-lib.CfnParameter",
|
|
277
|
+
"version": "2.118.0"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"CheckBootstrapVersion": {
|
|
281
|
+
"id": "CheckBootstrapVersion",
|
|
282
|
+
"path": "lamsec-deployFunction/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion",
|
|
283
|
+
"constructInfo": {
|
|
284
|
+
"fqn": "aws-cdk-lib.CfnRule",
|
|
285
|
+
"version": "2.118.0"
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"constructInfo": {
|
|
290
|
+
"fqn": "aws-cdk-lib.Stack",
|
|
291
|
+
"version": "2.118.0"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"constructInfo": {
|
|
296
|
+
"fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase",
|
|
297
|
+
"version": "2.118.0-alpha.0"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"constructInfo": {
|
|
302
|
+
"fqn": "@aws-cdk/integ-tests-alpha.IntegTest",
|
|
303
|
+
"version": "2.118.0-alpha.0"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"BootstrapVersion": {
|
|
307
|
+
"id": "BootstrapVersion",
|
|
308
|
+
"path": "lamsec-deployFunction/BootstrapVersion",
|
|
309
|
+
"constructInfo": {
|
|
310
|
+
"fqn": "aws-cdk-lib.CfnParameter",
|
|
311
|
+
"version": "2.118.0"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"CheckBootstrapVersion": {
|
|
315
|
+
"id": "CheckBootstrapVersion",
|
|
316
|
+
"path": "lamsec-deployFunction/CheckBootstrapVersion",
|
|
317
|
+
"constructInfo": {
|
|
318
|
+
"fqn": "aws-cdk-lib.CfnRule",
|
|
319
|
+
"version": "2.118.0"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"constructInfo": {
|
|
324
|
+
"fqn": "aws-cdk-lib.Stack",
|
|
325
|
+
"version": "2.118.0"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"Tree": {
|
|
329
|
+
"id": "Tree",
|
|
330
|
+
"path": "Tree",
|
|
331
|
+
"constructInfo": {
|
|
332
|
+
"fqn": "constructs.Construct",
|
|
333
|
+
"version": "10.0.0"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"constructInfo": {
|
|
338
|
+
"fqn": "aws-cdk-lib.App",
|
|
339
|
+
"version": "2.118.0"
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
@@ -18,6 +18,7 @@ const lib_1 = require("../lib");
|
|
|
18
18
|
const lambda = require("aws-cdk-lib/aws-lambda");
|
|
19
19
|
const defaults = require("@aws-solutions-constructs/core");
|
|
20
20
|
const core_1 = require("@aws-solutions-constructs/core");
|
|
21
|
+
const integ_tests_alpha_1 = require("@aws-cdk/integ-tests-alpha");
|
|
21
22
|
// Setup
|
|
22
23
|
const app = new aws_cdk_lib_1.App();
|
|
23
24
|
const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
|
|
@@ -43,6 +44,9 @@ const props = {
|
|
|
43
44
|
existingVpc: vpc
|
|
44
45
|
};
|
|
45
46
|
new lib_1.LambdaToSecretsmanager(stack, "test-lambda-secretsmanager-stack", props);
|
|
47
|
+
defaults.suppressCustomHandlerCfnNagWarnings(stack, 'Custom::VpcRestrictDefaultSGCustomResourceProvider');
|
|
46
48
|
// Synth
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
new integ_tests_alpha_1.IntegTest(stack, 'Integ', { testCases: [
|
|
50
|
+
stack
|
|
51
|
+
] });
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcubGFtc2VjLWRlcGxveUZ1bmN0aW9uV2l0aEV4aXN0aW5nVnBjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW50ZWcubGFtc2VjLWRlcGxveUZ1bmN0aW9uV2l0aEV4aXN0aW5nVnBjLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7R0FXRzs7QUFFSCxVQUFVO0FBQ1YsNkNBQXNEO0FBQ3RELGdDQUE2RTtBQUM3RSxpREFBaUQ7QUFDakQsMkRBQTJEO0FBQzNELHlEQUF3RTtBQUN4RSxrRUFBdUQ7QUFFdkQsUUFBUTtBQUNSLE1BQU0sR0FBRyxHQUFHLElBQUksaUJBQUcsRUFBRSxDQUFDO0FBQ3RCLE1BQU0sS0FBSyxHQUFHLElBQUksbUJBQUssQ0FBQyxHQUFHLEVBQUUsNkJBQX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JuYW1lfS9sYW1iZGFgKSxcbiAgfSxcbiAgc2VjcmV0UHJvcHM6IHtcbiAgICByZW1vdmFsUG9saWN5OiBSZW1vdmFsUG9saWN5LkRFU1RST1lcbiAgfSxcbiAgZXhpc3RpbmdWcGM6IHZwY1xufTtcblxubmV3IExhbWJkYVRvU2VjcmV0c21hbmFnZXIoc3RhY2ssIFwidGVzdC1sYW1iZGEtc2VjcmV0c21hbmFnZXItc3RhY2tcIiwgcHJvcHMpO1xuXG5kZWZhdWx0cy5zdXBwcmVzc0N1c3RvbUhhbmRsZXJDZm5OYWdXYXJuaW5ncyhzdGFjaywgJ0N1c3RvbTo6VnBjUmVzdHJpY3REZWZhdWx0U0dDdXN0b21SZXNvdXJjZVByb3ZpZGVyJyk7XG5cbi8vIFN5bnRoXG5uZXcgSW50ZWdUZXN0KHN0YWNrLCAnSW50ZWcnLCB7IHRlc3RDYXNlczogW1xuICBzdGFja1xuXSB9KTtcbiJdfQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withRetries=exports.handler=exports.external=void 0;const https=require("https"),url=require("url");exports.external={sendHttpRequest:defaultSendHttpRequest,log:defaultLog,includeStackTraces:!0,userHandlerIndex:"./index"};const CREATE_FAILED_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",MISSING_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";async function handler(event,context){const sanitizedEvent={...event,ResponseURL:"..."};if(exports.external.log(JSON.stringify(sanitizedEvent,void 0,2)),event.RequestType==="Delete"&&event.PhysicalResourceId===CREATE_FAILED_PHYSICAL_ID_MARKER){exports.external.log("ignoring DELETE event caused by a failed CREATE event"),await submitResponse("SUCCESS",event);return}try{const userHandler=require(exports.external.userHandlerIndex).handler,result=await userHandler(sanitizedEvent,context),responseEvent=renderResponse(event,result);await submitResponse("SUCCESS",responseEvent)}catch(e){const resp={...event,Reason:exports.external.includeStackTraces?e.stack:e.message};resp.PhysicalResourceId||(event.RequestType==="Create"?(exports.external.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),resp.PhysicalResourceId=CREATE_FAILED_PHYSICAL_ID_MARKER):exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`)),await submitResponse("FAILED",resp)}}exports.handler=handler;function renderResponse(cfnRequest,handlerResponse={}){const physicalResourceId=handlerResponse.PhysicalResourceId??cfnRequest.PhysicalResourceId??cfnRequest.RequestId;if(cfnRequest.RequestType==="Delete"&&physicalResourceId!==cfnRequest.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`);return{...cfnRequest,...handlerResponse,PhysicalResourceId:physicalResourceId}}async function submitResponse(status,event){const json={Status:status,Reason:event.Reason??status,StackId:event.StackId,RequestId:event.RequestId,PhysicalResourceId:event.PhysicalResourceId||MISSING_PHYSICAL_ID_MARKER,LogicalResourceId:event.LogicalResourceId,NoEcho:event.NoEcho,Data:event.Data};exports.external.log("submit response to cloudformation",json);const responseBody=JSON.stringify(json),parsedUrl=url.parse(event.ResponseURL),req={hostname:parsedUrl.hostname,path:parsedUrl.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(responseBody,"utf8")}};await withRetries({attempts:5,sleep:1e3},exports.external.sendHttpRequest)(req,responseBody)}async function defaultSendHttpRequest(options,responseBody){return new Promise((resolve,reject)=>{try{const request=https.request(options,_=>resolve());request.on("error",reject),request.write(responseBody),request.end()}catch(e){reject(e)}})}function defaultLog(fmt,...params){console.log(fmt,...params)}function withRetries(options,fn){return async(...xs)=>{let attempts=options.attempts,ms=options.sleep;for(;;)try{return await fn(...xs)}catch(e){if(attempts--<=0)throw e;await sleep(Math.floor(Math.random()*ms)),ms*=2}}}exports.withRetries=withRetries;async function sleep(ms){return new Promise(ok=>setTimeout(ok,ms))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var I=Object.create,t=Object.defineProperty,y=Object.getOwnPropertyDescriptor,P=Object.getOwnPropertyNames,g=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,G=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},n=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!l.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(i=y(e,s))||i.enumerable});return r},R=(r,e,o)=>(o=r!=null?I(g(r)):{},n(e||!r||!r.__esModule?t(o,"default",{value:r,enumerable:!0}):o,r)),S=r=>n(t({},"__esModule",{value:!0}),r),k={};G(k,{handler:()=>f}),module.exports=S(k);var a=R(require("@aws-sdk/client-ec2")),u=new a.EC2({});function c(r,e){return{GroupId:r,IpPermissions:[{UserIdGroupPairs:[{GroupId:r,UserId:e}],IpProtocol:"-1"}]}}function d(r){return{GroupId:r,IpPermissions:[{IpRanges:[{CidrIp:"0.0.0.0/0"}],IpProtocol:"-1"}]}}async function f(r){let e=r.ResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.Account;switch(r.RequestType){case"Create":return p(e,o);case"Update":return h(r);case"Delete":return m(e,o)}}async function h(r){let e=r.OldResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.DefaultSecurityGroupId;e!==o&&(await m(e,r.ResourceProperties.Account),await p(o,r.ResourceProperties.Account))}async function p(r,e){try{await u.revokeSecurityGroupEgress(d(r))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}try{await u.revokeSecurityGroupIngress(c(r,e))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}}async function m(r,e){await u.authorizeSecurityGroupIngress(c(r,e)),await u.authorizeSecurityGroupEgress(d(r))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"36.0.0"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"testCases": {
|
|
4
|
+
"lamsec-deployFunctionWithExistingVpc/Integ/DefaultTest": {
|
|
5
|
+
"stacks": [
|
|
6
|
+
"lamsec-deployFunctionWithExistingVpc"
|
|
7
|
+
],
|
|
8
|
+
"assertionStack": "lamsec-deployFunctionWithExistingVpc/Integ/DefaultTest/DeployAssert",
|
|
9
|
+
"assertionStackName": "lamsecdeployFunctionWithExistingVpcIntegDefaultTestDeployAssert647243A7"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "36.0.0",
|
|
3
|
+
"files": {
|
|
4
|
+
"dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e": {
|
|
5
|
+
"source": {
|
|
6
|
+
"path": "asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e",
|
|
7
|
+
"packaging": "zip"
|
|
8
|
+
},
|
|
9
|
+
"destinations": {
|
|
10
|
+
"current_account-current_region": {
|
|
11
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
12
|
+
"objectKey": "dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e.zip",
|
|
13
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8": {
|
|
18
|
+
"source": {
|
|
19
|
+
"path": "asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8",
|
|
20
|
+
"packaging": "zip"
|
|
21
|
+
},
|
|
22
|
+
"destinations": {
|
|
23
|
+
"current_account-current_region": {
|
|
24
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
25
|
+
"objectKey": "0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8.zip",
|
|
26
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"866ffc8bad93a64431285277a99984416862edce03b94fdce329050fccc8d372": {
|
|
31
|
+
"source": {
|
|
32
|
+
"path": "lamsec-deployFunctionWithExistingVpc.template.json",
|
|
33
|
+
"packaging": "file"
|
|
34
|
+
},
|
|
35
|
+
"destinations": {
|
|
36
|
+
"current_account-current_region": {
|
|
37
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
38
|
+
"objectKey": "866ffc8bad93a64431285277a99984416862edce03b94fdce329050fccc8d372.json",
|
|
39
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"dockerImages": {}
|
|
45
|
+
}
|