@aws-solutions-constructs/aws-lambda-dynamodb 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 (75) 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.lamddb-add-secondary-index.js +5 -2
  7. package/test/integ.lamddb-add-secondary-index.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  8. package/test/integ.lamddb-add-secondary-index.js.snapshot/cdk.out +1 -0
  9. package/test/integ.lamddb-add-secondary-index.js.snapshot/integ.json +12 -0
  10. package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddb-add-secondary-index.assets.json +32 -0
  11. package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddb-add-secondary-index.template.json +262 -0
  12. package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.assets.json +19 -0
  13. package/test/integ.lamddb-add-secondary-index.js.snapshot/lamddbaddsecondaryindexIntegDefaultTestDeployAssert3193B4D9.template.json +36 -0
  14. package/test/integ.lamddb-add-secondary-index.js.snapshot/manifest.json +131 -0
  15. package/test/integ.lamddb-add-secondary-index.js.snapshot/tree.json +415 -0
  16. package/test/integ.lamddb-deployFunctionWithExistingVpc.js +6 -2
  17. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  18. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
  19. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
  20. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/cdk.out +1 -0
  21. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/integ.json +12 -0
  22. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddb-deployFunctionWithExistingVpc.assets.json +45 -0
  23. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddb-deployFunctionWithExistingVpc.template.json +984 -0
  24. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddbdeployFunctionWithExistingVpcIntegDefaultTestDeployAssertEE08E38E.assets.json +19 -0
  25. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddbdeployFunctionWithExistingVpcIntegDefaultTestDeployAssertEE08E38E.template.json +36 -0
  26. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/manifest.json +323 -0
  27. package/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/tree.json +1372 -0
  28. package/test/integ.lamddb-deployFunctionWithVpc.js +6 -2
  29. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  30. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
  31. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
  32. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/cdk.out +1 -0
  33. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/integ.json +12 -0
  34. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddb-deployFunctionWithVpc.assets.json +45 -0
  35. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddb-deployFunctionWithVpc.template.json +694 -0
  36. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddbdeployFunctionWithVpcIntegDefaultTestDeployAssert0AB8275C.assets.json +19 -0
  37. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddbdeployFunctionWithVpcIntegDefaultTestDeployAssert0AB8275C.template.json +36 -0
  38. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/manifest.json +227 -0
  39. package/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/tree.json +954 -0
  40. package/test/integ.lamddb-no-arguments.js +5 -2
  41. package/test/integ.lamddb-no-arguments.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  42. package/test/integ.lamddb-no-arguments.js.snapshot/cdk.out +1 -0
  43. package/test/integ.lamddb-no-arguments.js.snapshot/integ.json +12 -0
  44. package/test/integ.lamddb-no-arguments.js.snapshot/lamddb-no-arguments.assets.json +32 -0
  45. package/test/integ.lamddb-no-arguments.js.snapshot/lamddb-no-arguments.template.json +233 -0
  46. package/test/integ.lamddb-no-arguments.js.snapshot/lamddbnoargumentsIntegDefaultTestDeployAssert248B75D0.assets.json +19 -0
  47. package/test/integ.lamddb-no-arguments.js.snapshot/lamddbnoargumentsIntegDefaultTestDeployAssert248B75D0.template.json +36 -0
  48. package/test/integ.lamddb-no-arguments.js.snapshot/manifest.json +131 -0
  49. package/test/integ.lamddb-no-arguments.js.snapshot/tree.json +386 -0
  50. package/test/integ.lamddb-set-billing-mode.js +5 -2
  51. package/test/integ.lamddb-set-billing-mode.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  52. package/test/integ.lamddb-set-billing-mode.js.snapshot/cdk.out +1 -0
  53. package/test/integ.lamddb-set-billing-mode.js.snapshot/integ.json +12 -0
  54. package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddb-set-billing-mode.assets.json +32 -0
  55. package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddb-set-billing-mode.template.json +246 -0
  56. package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddbsetbillingmodeIntegDefaultTestDeployAssertDAE32272.assets.json +19 -0
  57. package/test/integ.lamddb-set-billing-mode.js.snapshot/lamddbsetbillingmodeIntegDefaultTestDeployAssertDAE32272.template.json +36 -0
  58. package/test/integ.lamddb-set-billing-mode.js.snapshot/manifest.json +131 -0
  59. package/test/integ.lamddb-set-billing-mode.js.snapshot/tree.json +389 -0
  60. package/test/integ.lamddb-use-existing-func.js +5 -2
  61. package/test/integ.lamddb-use-existing-func.js.snapshot/asset.0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8/index.js +8 -0
  62. package/test/integ.lamddb-use-existing-func.js.snapshot/cdk.out +1 -0
  63. package/test/integ.lamddb-use-existing-func.js.snapshot/integ.json +12 -0
  64. package/test/integ.lamddb-use-existing-func.js.snapshot/lamddb-use-existing-func.assets.json +32 -0
  65. package/test/integ.lamddb-use-existing-func.js.snapshot/lamddb-use-existing-func.template.json +233 -0
  66. package/test/integ.lamddb-use-existing-func.js.snapshot/lamddbuseexistingfuncIntegDefaultTestDeployAssert48D284DD.assets.json +19 -0
  67. package/test/integ.lamddb-use-existing-func.js.snapshot/lamddbuseexistingfuncIntegDefaultTestDeployAssert48D284DD.template.json +36 -0
  68. package/test/integ.lamddb-use-existing-func.js.snapshot/manifest.json +131 -0
  69. package/test/integ.lamddb-use-existing-func.js.snapshot/tree.json +386 -0
  70. package/test/integ.lamddb-add-secondary-index.expected.json +0 -262
  71. package/test/integ.lamddb-deployFunctionWithExistingVpc.expected.json +0 -1012
  72. package/test/integ.lamddb-deployFunctionWithVpc.expected.json +0 -609
  73. package/test/integ.lamddb-no-arguments.expected.json +0 -233
  74. package/test/integ.lamddb-set-billing-mode.expected.json +0 -246
  75. package/test/integ.lamddb-use-existing-func.expected.json +0 -233
@@ -0,0 +1,386 @@
1
+ {
2
+ "version": "tree-0.1",
3
+ "tree": {
4
+ "id": "App",
5
+ "path": "",
6
+ "children": {
7
+ "lamddb-use-existing-func": {
8
+ "id": "lamddb-use-existing-func",
9
+ "path": "lamddb-use-existing-func",
10
+ "children": {
11
+ "LambdaFunctionServiceRole": {
12
+ "id": "LambdaFunctionServiceRole",
13
+ "path": "lamddb-use-existing-func/LambdaFunctionServiceRole",
14
+ "children": {
15
+ "ImportLambdaFunctionServiceRole": {
16
+ "id": "ImportLambdaFunctionServiceRole",
17
+ "path": "lamddb-use-existing-func/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole",
18
+ "constructInfo": {
19
+ "fqn": "aws-cdk-lib.Resource",
20
+ "version": "2.118.0"
21
+ }
22
+ },
23
+ "Resource": {
24
+ "id": "Resource",
25
+ "path": "lamddb-use-existing-func/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": "lamddb-use-existing-func/LambdaFunctionServiceRole/DefaultPolicy",
89
+ "children": {
90
+ "Resource": {
91
+ "id": "Resource",
92
+ "path": "lamddb-use-existing-func/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": [
108
+ "dynamodb:BatchGetItem",
109
+ "dynamodb:BatchWriteItem",
110
+ "dynamodb:ConditionCheckItem",
111
+ "dynamodb:DeleteItem",
112
+ "dynamodb:DescribeTable",
113
+ "dynamodb:GetItem",
114
+ "dynamodb:GetRecords",
115
+ "dynamodb:GetShardIterator",
116
+ "dynamodb:PutItem",
117
+ "dynamodb:Query",
118
+ "dynamodb:Scan",
119
+ "dynamodb:UpdateItem"
120
+ ],
121
+ "Effect": "Allow",
122
+ "Resource": [
123
+ {
124
+ "Fn::GetAtt": [
125
+ "testlambdadynamodbstackDynamoTable8138E93B",
126
+ "Arn"
127
+ ]
128
+ },
129
+ {
130
+ "Ref": "AWS::NoValue"
131
+ }
132
+ ]
133
+ }
134
+ ],
135
+ "Version": "2012-10-17"
136
+ },
137
+ "policyName": "LambdaFunctionServiceRoleDefaultPolicy126C8897",
138
+ "roles": [
139
+ {
140
+ "Ref": "LambdaFunctionServiceRole0C4CDE0B"
141
+ }
142
+ ]
143
+ }
144
+ },
145
+ "constructInfo": {
146
+ "fqn": "aws-cdk-lib.aws_iam.CfnPolicy",
147
+ "version": "2.118.0"
148
+ }
149
+ }
150
+ },
151
+ "constructInfo": {
152
+ "fqn": "aws-cdk-lib.aws_iam.Policy",
153
+ "version": "2.118.0"
154
+ }
155
+ }
156
+ },
157
+ "constructInfo": {
158
+ "fqn": "aws-cdk-lib.aws_iam.Role",
159
+ "version": "2.118.0"
160
+ }
161
+ },
162
+ "LambdaFunction": {
163
+ "id": "LambdaFunction",
164
+ "path": "lamddb-use-existing-func/LambdaFunction",
165
+ "children": {
166
+ "Code": {
167
+ "id": "Code",
168
+ "path": "lamddb-use-existing-func/LambdaFunction/Code",
169
+ "children": {
170
+ "Stage": {
171
+ "id": "Stage",
172
+ "path": "lamddb-use-existing-func/LambdaFunction/Code/Stage",
173
+ "constructInfo": {
174
+ "fqn": "aws-cdk-lib.AssetStaging",
175
+ "version": "2.118.0"
176
+ }
177
+ },
178
+ "AssetBucket": {
179
+ "id": "AssetBucket",
180
+ "path": "lamddb-use-existing-func/LambdaFunction/Code/AssetBucket",
181
+ "constructInfo": {
182
+ "fqn": "aws-cdk-lib.aws_s3.BucketBase",
183
+ "version": "2.118.0"
184
+ }
185
+ }
186
+ },
187
+ "constructInfo": {
188
+ "fqn": "aws-cdk-lib.aws_s3_assets.Asset",
189
+ "version": "2.118.0"
190
+ }
191
+ },
192
+ "Resource": {
193
+ "id": "Resource",
194
+ "path": "lamddb-use-existing-func/LambdaFunction/Resource",
195
+ "attributes": {
196
+ "aws:cdk:cloudformation:type": "AWS::Lambda::Function",
197
+ "aws:cdk:cloudformation:props": {
198
+ "code": {
199
+ "s3Bucket": {
200
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
201
+ },
202
+ "s3Key": "0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8.zip"
203
+ },
204
+ "environment": {
205
+ "variables": {
206
+ "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
207
+ "DDB_TABLE_NAME": {
208
+ "Ref": "testlambdadynamodbstackDynamoTable8138E93B"
209
+ }
210
+ }
211
+ },
212
+ "handler": "index.handler",
213
+ "role": {
214
+ "Fn::GetAtt": [
215
+ "LambdaFunctionServiceRole0C4CDE0B",
216
+ "Arn"
217
+ ]
218
+ },
219
+ "runtime": "nodejs16.x",
220
+ "tracingConfig": {
221
+ "mode": "Active"
222
+ }
223
+ }
224
+ },
225
+ "constructInfo": {
226
+ "fqn": "aws-cdk-lib.aws_lambda.CfnFunction",
227
+ "version": "2.118.0"
228
+ }
229
+ }
230
+ },
231
+ "constructInfo": {
232
+ "fqn": "aws-cdk-lib.aws_lambda.Function",
233
+ "version": "2.118.0"
234
+ }
235
+ },
236
+ "test-lambda-dynamodb-stack": {
237
+ "id": "test-lambda-dynamodb-stack",
238
+ "path": "lamddb-use-existing-func/test-lambda-dynamodb-stack",
239
+ "children": {
240
+ "DynamoTable": {
241
+ "id": "DynamoTable",
242
+ "path": "lamddb-use-existing-func/test-lambda-dynamodb-stack/DynamoTable",
243
+ "children": {
244
+ "Resource": {
245
+ "id": "Resource",
246
+ "path": "lamddb-use-existing-func/test-lambda-dynamodb-stack/DynamoTable/Resource",
247
+ "attributes": {
248
+ "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table",
249
+ "aws:cdk:cloudformation:props": {
250
+ "attributeDefinitions": [
251
+ {
252
+ "attributeName": "id",
253
+ "attributeType": "S"
254
+ }
255
+ ],
256
+ "billingMode": "PAY_PER_REQUEST",
257
+ "keySchema": [
258
+ {
259
+ "attributeName": "id",
260
+ "keyType": "HASH"
261
+ }
262
+ ],
263
+ "pointInTimeRecoverySpecification": {
264
+ "pointInTimeRecoveryEnabled": true
265
+ },
266
+ "sseSpecification": {
267
+ "sseEnabled": true
268
+ }
269
+ }
270
+ },
271
+ "constructInfo": {
272
+ "fqn": "aws-cdk-lib.aws_dynamodb.CfnTable",
273
+ "version": "2.118.0"
274
+ }
275
+ },
276
+ "ScalingRole": {
277
+ "id": "ScalingRole",
278
+ "path": "lamddb-use-existing-func/test-lambda-dynamodb-stack/DynamoTable/ScalingRole",
279
+ "constructInfo": {
280
+ "fqn": "aws-cdk-lib.Resource",
281
+ "version": "2.118.0"
282
+ }
283
+ }
284
+ },
285
+ "constructInfo": {
286
+ "fqn": "aws-cdk-lib.aws_dynamodb.Table",
287
+ "version": "2.118.0"
288
+ }
289
+ }
290
+ },
291
+ "constructInfo": {
292
+ "fqn": "@aws-solutions-constructs/aws-lambda-dynamodb.LambdaToDynamoDB",
293
+ "version": "2.50.0"
294
+ }
295
+ },
296
+ "Integ": {
297
+ "id": "Integ",
298
+ "path": "lamddb-use-existing-func/Integ",
299
+ "children": {
300
+ "DefaultTest": {
301
+ "id": "DefaultTest",
302
+ "path": "lamddb-use-existing-func/Integ/DefaultTest",
303
+ "children": {
304
+ "Default": {
305
+ "id": "Default",
306
+ "path": "lamddb-use-existing-func/Integ/DefaultTest/Default",
307
+ "constructInfo": {
308
+ "fqn": "constructs.Construct",
309
+ "version": "10.0.0"
310
+ }
311
+ },
312
+ "DeployAssert": {
313
+ "id": "DeployAssert",
314
+ "path": "lamddb-use-existing-func/Integ/DefaultTest/DeployAssert",
315
+ "children": {
316
+ "BootstrapVersion": {
317
+ "id": "BootstrapVersion",
318
+ "path": "lamddb-use-existing-func/Integ/DefaultTest/DeployAssert/BootstrapVersion",
319
+ "constructInfo": {
320
+ "fqn": "aws-cdk-lib.CfnParameter",
321
+ "version": "2.118.0"
322
+ }
323
+ },
324
+ "CheckBootstrapVersion": {
325
+ "id": "CheckBootstrapVersion",
326
+ "path": "lamddb-use-existing-func/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion",
327
+ "constructInfo": {
328
+ "fqn": "aws-cdk-lib.CfnRule",
329
+ "version": "2.118.0"
330
+ }
331
+ }
332
+ },
333
+ "constructInfo": {
334
+ "fqn": "aws-cdk-lib.Stack",
335
+ "version": "2.118.0"
336
+ }
337
+ }
338
+ },
339
+ "constructInfo": {
340
+ "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase",
341
+ "version": "2.118.0-alpha.0"
342
+ }
343
+ }
344
+ },
345
+ "constructInfo": {
346
+ "fqn": "@aws-cdk/integ-tests-alpha.IntegTest",
347
+ "version": "2.118.0-alpha.0"
348
+ }
349
+ },
350
+ "BootstrapVersion": {
351
+ "id": "BootstrapVersion",
352
+ "path": "lamddb-use-existing-func/BootstrapVersion",
353
+ "constructInfo": {
354
+ "fqn": "aws-cdk-lib.CfnParameter",
355
+ "version": "2.118.0"
356
+ }
357
+ },
358
+ "CheckBootstrapVersion": {
359
+ "id": "CheckBootstrapVersion",
360
+ "path": "lamddb-use-existing-func/CheckBootstrapVersion",
361
+ "constructInfo": {
362
+ "fqn": "aws-cdk-lib.CfnRule",
363
+ "version": "2.118.0"
364
+ }
365
+ }
366
+ },
367
+ "constructInfo": {
368
+ "fqn": "aws-cdk-lib.Stack",
369
+ "version": "2.118.0"
370
+ }
371
+ },
372
+ "Tree": {
373
+ "id": "Tree",
374
+ "path": "Tree",
375
+ "constructInfo": {
376
+ "fqn": "constructs.Construct",
377
+ "version": "10.0.0"
378
+ }
379
+ }
380
+ },
381
+ "constructInfo": {
382
+ "fqn": "aws-cdk-lib.App",
383
+ "version": "2.118.0"
384
+ }
385
+ }
386
+ }
@@ -1,262 +0,0 @@
1
- {
2
- "Resources": {
3
- "testlambdadynamodbstackLambdaFunctionServiceRole758347A1": {
4
- "Type": "AWS::IAM::Role",
5
- "Properties": {
6
- "AssumeRolePolicyDocument": {
7
- "Statement": [
8
- {
9
- "Action": "sts:AssumeRole",
10
- "Effect": "Allow",
11
- "Principal": {
12
- "Service": "lambda.amazonaws.com"
13
- }
14
- }
15
- ],
16
- "Version": "2012-10-17"
17
- },
18
- "Policies": [
19
- {
20
- "PolicyDocument": {
21
- "Statement": [
22
- {
23
- "Action": [
24
- "logs:CreateLogGroup",
25
- "logs:CreateLogStream",
26
- "logs:PutLogEvents"
27
- ],
28
- "Effect": "Allow",
29
- "Resource": {
30
- "Fn::Join": [
31
- "",
32
- [
33
- "arn:",
34
- {
35
- "Ref": "AWS::Partition"
36
- },
37
- ":logs:",
38
- {
39
- "Ref": "AWS::Region"
40
- },
41
- ":",
42
- {
43
- "Ref": "AWS::AccountId"
44
- },
45
- ":log-group:/aws/lambda/*"
46
- ]
47
- ]
48
- }
49
- }
50
- ],
51
- "Version": "2012-10-17"
52
- },
53
- "PolicyName": "LambdaFunctionServiceRolePolicy"
54
- }
55
- ]
56
- }
57
- },
58
- "testlambdadynamodbstackLambdaFunctionServiceRoleDefaultPolicy547FB7F4": {
59
- "Type": "AWS::IAM::Policy",
60
- "Properties": {
61
- "PolicyDocument": {
62
- "Statement": [
63
- {
64
- "Action": [
65
- "xray:PutTraceSegments",
66
- "xray:PutTelemetryRecords"
67
- ],
68
- "Effect": "Allow",
69
- "Resource": "*"
70
- },
71
- {
72
- "Action": [
73
- "dynamodb:BatchGetItem",
74
- "dynamodb:GetRecords",
75
- "dynamodb:GetShardIterator",
76
- "dynamodb:Query",
77
- "dynamodb:GetItem",
78
- "dynamodb:Scan",
79
- "dynamodb:ConditionCheckItem",
80
- "dynamodb:BatchWriteItem",
81
- "dynamodb:PutItem",
82
- "dynamodb:UpdateItem",
83
- "dynamodb:DeleteItem",
84
- "dynamodb:DescribeTable"
85
- ],
86
- "Effect": "Allow",
87
- "Resource": [
88
- {
89
- "Fn::GetAtt": [
90
- "testlambdadynamodbstackDynamoTable8138E93B",
91
- "Arn"
92
- ]
93
- },
94
- {
95
- "Fn::Join": [
96
- "",
97
- [
98
- {
99
- "Fn::GetAtt": [
100
- "testlambdadynamodbstackDynamoTable8138E93B",
101
- "Arn"
102
- ]
103
- },
104
- "/index/*"
105
- ]
106
- ]
107
- }
108
- ]
109
- }
110
- ],
111
- "Version": "2012-10-17"
112
- },
113
- "PolicyName": "testlambdadynamodbstackLambdaFunctionServiceRoleDefaultPolicy547FB7F4",
114
- "Roles": [
115
- {
116
- "Ref": "testlambdadynamodbstackLambdaFunctionServiceRole758347A1"
117
- }
118
- ]
119
- },
120
- "Metadata": {
121
- "cfn_nag": {
122
- "rules_to_suppress": [
123
- {
124
- "id": "W12",
125
- "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
126
- }
127
- ]
128
- }
129
- }
130
- },
131
- "testlambdadynamodbstackLambdaFunction5DDB3E8D": {
132
- "Type": "AWS::Lambda::Function",
133
- "Properties": {
134
- "Code": {
135
- "S3Bucket": {
136
- "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
137
- },
138
- "S3Key": "0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8.zip"
139
- },
140
- "Environment": {
141
- "Variables": {
142
- "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
143
- "DDB_TABLE_NAME": {
144
- "Ref": "testlambdadynamodbstackDynamoTable8138E93B"
145
- }
146
- }
147
- },
148
- "Handler": "index.handler",
149
- "Role": {
150
- "Fn::GetAtt": [
151
- "testlambdadynamodbstackLambdaFunctionServiceRole758347A1",
152
- "Arn"
153
- ]
154
- },
155
- "Runtime": "nodejs16.x",
156
- "TracingConfig": {
157
- "Mode": "Active"
158
- }
159
- },
160
- "DependsOn": [
161
- "testlambdadynamodbstackLambdaFunctionServiceRoleDefaultPolicy547FB7F4",
162
- "testlambdadynamodbstackLambdaFunctionServiceRole758347A1"
163
- ],
164
- "Metadata": {
165
- "cfn_nag": {
166
- "rules_to_suppress": [
167
- {
168
- "id": "W58",
169
- "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."
170
- },
171
- {
172
- "id": "W89",
173
- "reason": "This is not a rule for the general case, just for specific use cases/industries"
174
- },
175
- {
176
- "id": "W92",
177
- "reason": "Impossible for us to define the correct concurrency for clients"
178
- }
179
- ]
180
- }
181
- }
182
- },
183
- "testlambdadynamodbstackDynamoTable8138E93B": {
184
- "Type": "AWS::DynamoDB::Table",
185
- "Properties": {
186
- "AttributeDefinitions": [
187
- {
188
- "AttributeName": "id",
189
- "AttributeType": "S"
190
- },
191
- {
192
- "AttributeName": "id2",
193
- "AttributeType": "S"
194
- }
195
- ],
196
- "BillingMode": "PAY_PER_REQUEST",
197
- "GlobalSecondaryIndexes": [
198
- {
199
- "IndexName": "test_id2",
200
- "KeySchema": [
201
- {
202
- "AttributeName": "id2",
203
- "KeyType": "HASH"
204
- }
205
- ],
206
- "Projection": {
207
- "ProjectionType": "ALL"
208
- }
209
- }
210
- ],
211
- "KeySchema": [
212
- {
213
- "AttributeName": "id",
214
- "KeyType": "HASH"
215
- }
216
- ],
217
- "PointInTimeRecoverySpecification": {
218
- "PointInTimeRecoveryEnabled": true
219
- },
220
- "SSESpecification": {
221
- "SSEEnabled": true
222
- }
223
- },
224
- "UpdateReplacePolicy": "Retain",
225
- "DeletionPolicy": "Retain"
226
- }
227
- },
228
- "Parameters": {
229
- "BootstrapVersion": {
230
- "Type": "AWS::SSM::Parameter::Value<String>",
231
- "Default": "/cdk-bootstrap/hnb659fds/version",
232
- "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
233
- }
234
- },
235
- "Rules": {
236
- "CheckBootstrapVersion": {
237
- "Assertions": [
238
- {
239
- "Assert": {
240
- "Fn::Not": [
241
- {
242
- "Fn::Contains": [
243
- [
244
- "1",
245
- "2",
246
- "3",
247
- "4",
248
- "5"
249
- ],
250
- {
251
- "Ref": "BootstrapVersion"
252
- }
253
- ]
254
- }
255
- ]
256
- },
257
- "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
258
- }
259
- ]
260
- }
261
- }
262
- }