@aws-solutions-constructs/aws-apigateway-dynamodb 2.31.0 → 2.33.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.
@@ -0,0 +1,426 @@
1
+ {
2
+ "Description": "Integration Test for aws-apigateway-dynamodb",
3
+ "Resources": {
4
+ "existingtableE51CCC93": {
5
+ "Type": "AWS::DynamoDB::Table",
6
+ "Properties": {
7
+ "KeySchema": [
8
+ {
9
+ "AttributeName": "PK",
10
+ "KeyType": "HASH"
11
+ },
12
+ {
13
+ "AttributeName": "SK",
14
+ "KeyType": "RANGE"
15
+ }
16
+ ],
17
+ "AttributeDefinitions": [
18
+ {
19
+ "AttributeName": "PK",
20
+ "AttributeType": "S"
21
+ },
22
+ {
23
+ "AttributeName": "SK",
24
+ "AttributeType": "S"
25
+ }
26
+ ],
27
+ "BillingMode": "PAY_PER_REQUEST",
28
+ "PointInTimeRecoverySpecification": {
29
+ "PointInTimeRecoveryEnabled": true
30
+ },
31
+ "SSESpecification": {
32
+ "SSEEnabled": true
33
+ }
34
+ },
35
+ "UpdateReplacePolicy": "Retain",
36
+ "DeletionPolicy": "Retain"
37
+ },
38
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameApiAccessLogGroup89C7FD92": {
39
+ "Type": "AWS::Logs::LogGroup",
40
+ "UpdateReplacePolicy": "Retain",
41
+ "DeletionPolicy": "Retain",
42
+ "Metadata": {
43
+ "cfn_nag": {
44
+ "rules_to_suppress": [
45
+ {
46
+ "id": "W86",
47
+ "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely"
48
+ },
49
+ {
50
+ "id": "W84",
51
+ "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ },
57
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE": {
58
+ "Type": "AWS::ApiGateway::RestApi",
59
+ "Properties": {
60
+ "EndpointConfiguration": {
61
+ "Types": [
62
+ "EDGE"
63
+ ]
64
+ },
65
+ "Name": "RestApi"
66
+ }
67
+ },
68
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiDeployment7F5497B67361a1e02c5799cae81447bf3ad5ef46": {
69
+ "Type": "AWS::ApiGateway::Deployment",
70
+ "Properties": {
71
+ "RestApiId": {
72
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE"
73
+ },
74
+ "Description": "Automatically created by the RestApi construct"
75
+ },
76
+ "DependsOn": [
77
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiidGETB657BB05",
78
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiid4EBF99AB"
79
+ ],
80
+ "Metadata": {
81
+ "cfn_nag": {
82
+ "rules_to_suppress": [
83
+ {
84
+ "id": "W45",
85
+ "reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checkes for it in AWS::ApiGateway::Deployment resource"
86
+ }
87
+ ]
88
+ }
89
+ }
90
+ },
91
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiDeploymentStageprodDD2DED0B": {
92
+ "Type": "AWS::ApiGateway::Stage",
93
+ "Properties": {
94
+ "RestApiId": {
95
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE"
96
+ },
97
+ "AccessLogSetting": {
98
+ "DestinationArn": {
99
+ "Fn::GetAtt": [
100
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameApiAccessLogGroup89C7FD92",
101
+ "Arn"
102
+ ]
103
+ },
104
+ "Format": "{\"requestId\":\"$context.requestId\",\"ip\":\"$context.identity.sourceIp\",\"user\":\"$context.identity.user\",\"caller\":\"$context.identity.caller\",\"requestTime\":\"$context.requestTime\",\"httpMethod\":\"$context.httpMethod\",\"resourcePath\":\"$context.resourcePath\",\"status\":\"$context.status\",\"protocol\":\"$context.protocol\",\"responseLength\":\"$context.responseLength\"}"
105
+ },
106
+ "DeploymentId": {
107
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiDeployment7F5497B67361a1e02c5799cae81447bf3ad5ef46"
108
+ },
109
+ "MethodSettings": [
110
+ {
111
+ "DataTraceEnabled": false,
112
+ "HttpMethod": "*",
113
+ "LoggingLevel": "INFO",
114
+ "ResourcePath": "/*"
115
+ }
116
+ ],
117
+ "StageName": "prod",
118
+ "TracingEnabled": true
119
+ }
120
+ },
121
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiid4EBF99AB": {
122
+ "Type": "AWS::ApiGateway::Resource",
123
+ "Properties": {
124
+ "ParentId": {
125
+ "Fn::GetAtt": [
126
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE",
127
+ "RootResourceId"
128
+ ]
129
+ },
130
+ "PathPart": "{id}",
131
+ "RestApiId": {
132
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE"
133
+ }
134
+ }
135
+ },
136
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiidGETB657BB05": {
137
+ "Type": "AWS::ApiGateway::Method",
138
+ "Properties": {
139
+ "HttpMethod": "GET",
140
+ "ResourceId": {
141
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiid4EBF99AB"
142
+ },
143
+ "RestApiId": {
144
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE"
145
+ },
146
+ "AuthorizationType": "AWS_IAM",
147
+ "Integration": {
148
+ "Credentials": {
149
+ "Fn::GetAtt": [
150
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameapigatewayrole3D282506",
151
+ "Arn"
152
+ ]
153
+ },
154
+ "IntegrationHttpMethod": "POST",
155
+ "IntegrationResponses": [
156
+ {
157
+ "StatusCode": "200"
158
+ },
159
+ {
160
+ "ResponseTemplates": {
161
+ "text/html": "Error"
162
+ },
163
+ "SelectionPattern": "500",
164
+ "StatusCode": "500"
165
+ }
166
+ ],
167
+ "PassthroughBehavior": "NEVER",
168
+ "RequestParameters": {
169
+ "integration.request.header.Content-Type": "'application/json'"
170
+ },
171
+ "RequestTemplates": {
172
+ "application/json": {
173
+ "Fn::Join": [
174
+ "",
175
+ [
176
+ "{ \"TableName\": \"",
177
+ {
178
+ "Ref": "existingtableE51CCC93"
179
+ },
180
+ "\", \"KeyConditionExpression\": \"PK = :v1\", \"ExpressionAttributeValues\": { \":v1\": { \"S\": \"$input.params('id')\" } } }"
181
+ ]
182
+ ]
183
+ },
184
+ "text/plain": {
185
+ "Fn::Join": [
186
+ "",
187
+ [
188
+ "{ \"TableName\": \"",
189
+ {
190
+ "Ref": "existingtableE51CCC93"
191
+ },
192
+ "\", \"KeyConditionExpression\": \"PK = :v2 AND SK = :v1\", \"ExpressionAttributeValues\": { \":v1\": { \"S\": \"$input.params('id')\" }, \":v2\": { \"S\": \"MY_VALUE\" } } }"
193
+ ]
194
+ ]
195
+ }
196
+ },
197
+ "Type": "AWS",
198
+ "Uri": {
199
+ "Fn::Join": [
200
+ "",
201
+ [
202
+ "arn:",
203
+ {
204
+ "Ref": "AWS::Partition"
205
+ },
206
+ ":apigateway:",
207
+ {
208
+ "Ref": "AWS::Region"
209
+ },
210
+ ":dynamodb:action/Query"
211
+ ]
212
+ ]
213
+ }
214
+ },
215
+ "MethodResponses": [
216
+ {
217
+ "ResponseParameters": {
218
+ "method.response.header.Content-Type": true
219
+ },
220
+ "StatusCode": "200"
221
+ },
222
+ {
223
+ "ResponseParameters": {
224
+ "method.response.header.Content-Type": true
225
+ },
226
+ "StatusCode": "500"
227
+ }
228
+ ]
229
+ }
230
+ },
231
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiUsagePlan4D14DF10": {
232
+ "Type": "AWS::ApiGateway::UsagePlan",
233
+ "Properties": {
234
+ "ApiStages": [
235
+ {
236
+ "ApiId": {
237
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE"
238
+ },
239
+ "Stage": {
240
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiDeploymentStageprodDD2DED0B"
241
+ },
242
+ "Throttle": {}
243
+ }
244
+ ]
245
+ }
246
+ },
247
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameLambdaRestApiCloudWatchRoleA4832ADD": {
248
+ "Type": "AWS::IAM::Role",
249
+ "Properties": {
250
+ "AssumeRolePolicyDocument": {
251
+ "Statement": [
252
+ {
253
+ "Action": "sts:AssumeRole",
254
+ "Effect": "Allow",
255
+ "Principal": {
256
+ "Service": "apigateway.amazonaws.com"
257
+ }
258
+ }
259
+ ],
260
+ "Version": "2012-10-17"
261
+ },
262
+ "Policies": [
263
+ {
264
+ "PolicyDocument": {
265
+ "Statement": [
266
+ {
267
+ "Action": [
268
+ "logs:CreateLogGroup",
269
+ "logs:CreateLogStream",
270
+ "logs:DescribeLogGroups",
271
+ "logs:DescribeLogStreams",
272
+ "logs:PutLogEvents",
273
+ "logs:GetLogEvents",
274
+ "logs:FilterLogEvents"
275
+ ],
276
+ "Effect": "Allow",
277
+ "Resource": {
278
+ "Fn::Join": [
279
+ "",
280
+ [
281
+ "arn:",
282
+ {
283
+ "Ref": "AWS::Partition"
284
+ },
285
+ ":logs:",
286
+ {
287
+ "Ref": "AWS::Region"
288
+ },
289
+ ":",
290
+ {
291
+ "Ref": "AWS::AccountId"
292
+ },
293
+ ":*"
294
+ ]
295
+ ]
296
+ }
297
+ }
298
+ ],
299
+ "Version": "2012-10-17"
300
+ },
301
+ "PolicyName": "LambdaRestApiCloudWatchRolePolicy"
302
+ }
303
+ ]
304
+ }
305
+ },
306
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameLambdaRestApiAccountFA4A4D09": {
307
+ "Type": "AWS::ApiGateway::Account",
308
+ "Properties": {
309
+ "CloudWatchRoleArn": {
310
+ "Fn::GetAtt": [
311
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameLambdaRestApiCloudWatchRoleA4832ADD",
312
+ "Arn"
313
+ ]
314
+ }
315
+ },
316
+ "DependsOn": [
317
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE"
318
+ ]
319
+ },
320
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameapigatewayrole3D282506": {
321
+ "Type": "AWS::IAM::Role",
322
+ "Properties": {
323
+ "AssumeRolePolicyDocument": {
324
+ "Statement": [
325
+ {
326
+ "Action": "sts:AssumeRole",
327
+ "Effect": "Allow",
328
+ "Principal": {
329
+ "Service": "apigateway.amazonaws.com"
330
+ }
331
+ }
332
+ ],
333
+ "Version": "2012-10-17"
334
+ }
335
+ }
336
+ },
337
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameapigatewayroleDefaultPolicyAC080A34": {
338
+ "Type": "AWS::IAM::Policy",
339
+ "Properties": {
340
+ "PolicyDocument": {
341
+ "Statement": [
342
+ {
343
+ "Action": "dynamodb:Query",
344
+ "Effect": "Allow",
345
+ "Resource": {
346
+ "Fn::GetAtt": [
347
+ "existingtableE51CCC93",
348
+ "Arn"
349
+ ]
350
+ }
351
+ }
352
+ ],
353
+ "Version": "2012-10-17"
354
+ },
355
+ "PolicyName": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameapigatewayroleDefaultPolicyAC080A34",
356
+ "Roles": [
357
+ {
358
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameapigatewayrole3D282506"
359
+ }
360
+ ]
361
+ }
362
+ }
363
+ },
364
+ "Outputs": {
365
+ "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiEndpoint4892309E": {
366
+ "Value": {
367
+ "Fn::Join": [
368
+ "",
369
+ [
370
+ "https://",
371
+ {
372
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiC4813ABE"
373
+ },
374
+ ".execute-api.",
375
+ {
376
+ "Ref": "AWS::Region"
377
+ },
378
+ ".",
379
+ {
380
+ "Ref": "AWS::URLSuffix"
381
+ },
382
+ "/",
383
+ {
384
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatescustomresourcenameRestApiDeploymentStageprodDD2DED0B"
385
+ },
386
+ "/"
387
+ ]
388
+ ]
389
+ }
390
+ }
391
+ },
392
+ "Parameters": {
393
+ "BootstrapVersion": {
394
+ "Type": "AWS::SSM::Parameter::Value<String>",
395
+ "Default": "/cdk-bootstrap/hnb659fds/version",
396
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
397
+ }
398
+ },
399
+ "Rules": {
400
+ "CheckBootstrapVersion": {
401
+ "Assertions": [
402
+ {
403
+ "Assert": {
404
+ "Fn::Not": [
405
+ {
406
+ "Fn::Contains": [
407
+ [
408
+ "1",
409
+ "2",
410
+ "3",
411
+ "4",
412
+ "5"
413
+ ],
414
+ {
415
+ "Ref": "BootstrapVersion"
416
+ }
417
+ ]
418
+ }
419
+ ]
420
+ },
421
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
422
+ }
423
+ ]
424
+ }
425
+ }
426
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
6
+ * with the License. A copy of the License is located at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
11
+ * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
12
+ * and limitations under the License.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ // Imports
16
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
17
+ const lib_1 = require("../lib");
18
+ const core_1 = require("@aws-solutions-constructs/core");
19
+ const dynamodb = require("aws-cdk-lib/aws-dynamodb");
20
+ // Setup
21
+ const app = new aws_cdk_lib_1.App();
22
+ const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
23
+ stack.templateOptions.description = 'Integration Test for aws-apigateway-dynamodb';
24
+ const partitionKeyName = 'PK';
25
+ const sortKeyName = 'SK';
26
+ const resourceName = 'id';
27
+ const existingTableObj = new dynamodb.Table(stack, 'existing-table', {
28
+ partitionKey: {
29
+ name: partitionKeyName,
30
+ type: dynamodb.AttributeType.STRING,
31
+ },
32
+ sortKey: {
33
+ name: sortKeyName,
34
+ type: dynamodb.AttributeType.STRING
35
+ },
36
+ pointInTimeRecovery: true,
37
+ encryption: dynamodb.TableEncryption.AWS_MANAGED,
38
+ billingMode: dynamodb.BillingMode.PAY_PER_REQUEST
39
+ });
40
+ new lib_1.ApiGatewayToDynamoDB(stack, 'test-api-gateway-dynamodb-additional-request-templates-custom-resource-name', {
41
+ existingTableObj,
42
+ resourceName,
43
+ additionalReadRequestTemplates: {
44
+ 'text/plain': `{ \
45
+ "TableName": "${existingTableObj.tableName}", \
46
+ "KeyConditionExpression": "${partitionKeyName} = :v2 AND ${sortKeyName} = :v1", \
47
+ "ExpressionAttributeValues": { \
48
+ ":v1": { \
49
+ "S": "$input.params('${resourceName}')" \
50
+ }, \
51
+ ":v2": { \
52
+ "S": "MY_VALUE" \
53
+ } \
54
+ } \
55
+ }`,
56
+ }
57
+ });
58
+ // Synth
59
+ app.synth();
60
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuYWRkaXRpb25hbC1yZXF1ZXN0LXRlbXBsYXRlcy1jdXN0b20tcmVzb3VyY2UtbmFtZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImludGVnLmFkZGl0aW9uYWwtcmVx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