@aws-solutions-constructs/aws-apigateway-dynamodb 2.44.0 → 2.46.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.
- package/.jsii +105 -14
- package/lib/index.d.ts +8 -0
- package/lib/index.js +65 -15
- package/package.json +5 -5
- package/test/apigateway-dynamodb.test.js +32 -6
- package/test/{integ.additional-request-templates-custom-resource-name.expected.json → integ.apiddb-additional-request-templates-custom-resource-name.expected.json} +21 -21
- package/test/integ.apiddb-additional-request-templates-custom-resource-name.js +60 -0
- package/test/{integ.additional-request-templates.expected.json → integ.apiddb-additional-request-templates.expected.json} +19 -19
- package/test/integ.apiddb-additional-request-templates.js +50 -0
- package/test/{integ.apigateway-dynamodb-CRUD.expected.json → integ.apiddb-apigateway-dynamodb-CRUD.expected.json} +46 -46
- package/test/integ.apiddb-apigateway-dynamodb-CRUD.js +35 -0
- package/test/{integ.apigateway-dynamodb-existing-table.expected.json → integ.apiddb-apigateway-dynamodb-existing-table.expected.json} +19 -19
- package/test/integ.apiddb-apigateway-dynamodb-existing-table.js +42 -0
- package/test/{integ.custom-integration-responses.expected.json → integ.apiddb-custom-integration-responses.expected.json} +19 -19
- package/test/integ.apiddb-custom-integration-responses.js +48 -0
- package/test/{integ.no-arguments.expected.json → integ.apiddb-no-arguments.expected.json} +19 -19
- package/test/integ.apiddb-no-arguments.js +28 -0
- package/test/integ.additional-request-templates-custom-resource-name.js +0 -60
- package/test/integ.additional-request-templates.js +0 -50
- package/test/integ.apigateway-dynamodb-CRUD.js +0 -35
- package/test/integ.apigateway-dynamodb-existing-table.js +0 -42
- package/test/integ.custom-integration-responses.js +0 -48
- package/test/integ.no-arguments.js +0 -28
- /package/test/{integ.additional-request-templates-custom-resource-name.d.ts → integ.apiddb-additional-request-templates-custom-resource-name.d.ts} +0 -0
- /package/test/{integ.additional-request-templates.d.ts → integ.apiddb-additional-request-templates.d.ts} +0 -0
- /package/test/{integ.apigateway-dynamodb-CRUD.d.ts → integ.apiddb-apigateway-dynamodb-CRUD.d.ts} +0 -0
- /package/test/{integ.apigateway-dynamodb-existing-table.d.ts → integ.apiddb-apigateway-dynamodb-existing-table.d.ts} +0 -0
- /package/test/{integ.custom-integration-responses.d.ts → integ.apiddb-custom-integration-responses.d.ts} +0 -0
- /package/test/{integ.no-arguments.d.ts → integ.apiddb-no-arguments.d.ts} +0 -0
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
"testapigatewaydynamodbDynamoTableEEE3F463": {
|
|
5
5
|
"Type": "AWS::DynamoDB::Table",
|
|
6
6
|
"Properties": {
|
|
7
|
-
"
|
|
7
|
+
"AttributeDefinitions": [
|
|
8
8
|
{
|
|
9
9
|
"AttributeName": "id",
|
|
10
|
-
"
|
|
10
|
+
"AttributeType": "S"
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
|
-
"
|
|
13
|
+
"BillingMode": "PAY_PER_REQUEST",
|
|
14
|
+
"KeySchema": [
|
|
14
15
|
{
|
|
15
16
|
"AttributeName": "id",
|
|
16
|
-
"
|
|
17
|
+
"KeyType": "HASH"
|
|
17
18
|
}
|
|
18
19
|
],
|
|
19
|
-
"BillingMode": "PAY_PER_REQUEST",
|
|
20
20
|
"PointInTimeRecoverySpecification": {
|
|
21
21
|
"PointInTimeRecoveryEnabled": true
|
|
22
22
|
},
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"testapigatewaydynamodbRestApiDeployment1898674B00abb8cad507ed5309ac584f2dddf379": {
|
|
61
61
|
"Type": "AWS::ApiGateway::Deployment",
|
|
62
62
|
"Properties": {
|
|
63
|
+
"Description": "Automatically created by the RestApi construct",
|
|
63
64
|
"RestApiId": {
|
|
64
65
|
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
65
|
-
}
|
|
66
|
-
"Description": "Automatically created by the RestApi construct"
|
|
66
|
+
}
|
|
67
67
|
},
|
|
68
68
|
"DependsOn": [
|
|
69
69
|
"testapigatewaydynamodbRestApiidDELETE6FC8A9F3",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"rules_to_suppress": [
|
|
78
78
|
{
|
|
79
79
|
"id": "W45",
|
|
80
|
-
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag
|
|
80
|
+
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource"
|
|
81
81
|
}
|
|
82
82
|
]
|
|
83
83
|
}
|
|
@@ -86,9 +86,6 @@
|
|
|
86
86
|
"testapigatewaydynamodbRestApiDeploymentStageprod2855C2C3": {
|
|
87
87
|
"Type": "AWS::ApiGateway::Stage",
|
|
88
88
|
"Properties": {
|
|
89
|
-
"RestApiId": {
|
|
90
|
-
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
91
|
-
},
|
|
92
89
|
"AccessLogSetting": {
|
|
93
90
|
"DestinationArn": {
|
|
94
91
|
"Fn::GetAtt": [
|
|
@@ -109,6 +106,9 @@
|
|
|
109
106
|
"ResourcePath": "/*"
|
|
110
107
|
}
|
|
111
108
|
],
|
|
109
|
+
"RestApiId": {
|
|
110
|
+
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
111
|
+
},
|
|
112
112
|
"StageName": "prod",
|
|
113
113
|
"TracingEnabled": true
|
|
114
114
|
}
|
|
@@ -131,14 +131,8 @@
|
|
|
131
131
|
"testapigatewaydynamodbRestApiidGET6196F638": {
|
|
132
132
|
"Type": "AWS::ApiGateway::Method",
|
|
133
133
|
"Properties": {
|
|
134
|
-
"HttpMethod": "GET",
|
|
135
|
-
"ResourceId": {
|
|
136
|
-
"Ref": "testapigatewaydynamodbRestApiid78018D34"
|
|
137
|
-
},
|
|
138
|
-
"RestApiId": {
|
|
139
|
-
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
140
|
-
},
|
|
141
134
|
"AuthorizationType": "AWS_IAM",
|
|
135
|
+
"HttpMethod": "GET",
|
|
142
136
|
"Integration": {
|
|
143
137
|
"Credentials": {
|
|
144
138
|
"Fn::GetAtt": [
|
|
@@ -208,20 +202,20 @@
|
|
|
208
202
|
},
|
|
209
203
|
"StatusCode": "500"
|
|
210
204
|
}
|
|
211
|
-
]
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
"testapigatewaydynamodbRestApiidPUT1F965B23": {
|
|
215
|
-
"Type": "AWS::ApiGateway::Method",
|
|
216
|
-
"Properties": {
|
|
217
|
-
"HttpMethod": "PUT",
|
|
205
|
+
],
|
|
218
206
|
"ResourceId": {
|
|
219
207
|
"Ref": "testapigatewaydynamodbRestApiid78018D34"
|
|
220
208
|
},
|
|
221
209
|
"RestApiId": {
|
|
222
210
|
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
223
|
-
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"testapigatewaydynamodbRestApiidPUT1F965B23": {
|
|
215
|
+
"Type": "AWS::ApiGateway::Method",
|
|
216
|
+
"Properties": {
|
|
224
217
|
"AuthorizationType": "AWS_IAM",
|
|
218
|
+
"HttpMethod": "PUT",
|
|
225
219
|
"Integration": {
|
|
226
220
|
"Credentials": {
|
|
227
221
|
"Fn::GetAtt": [
|
|
@@ -291,20 +285,20 @@
|
|
|
291
285
|
},
|
|
292
286
|
"StatusCode": "500"
|
|
293
287
|
}
|
|
294
|
-
]
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
"testapigatewaydynamodbRestApiidDELETE6FC8A9F3": {
|
|
298
|
-
"Type": "AWS::ApiGateway::Method",
|
|
299
|
-
"Properties": {
|
|
300
|
-
"HttpMethod": "DELETE",
|
|
288
|
+
],
|
|
301
289
|
"ResourceId": {
|
|
302
290
|
"Ref": "testapigatewaydynamodbRestApiid78018D34"
|
|
303
291
|
},
|
|
304
292
|
"RestApiId": {
|
|
305
293
|
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
306
|
-
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"testapigatewaydynamodbRestApiidDELETE6FC8A9F3": {
|
|
298
|
+
"Type": "AWS::ApiGateway::Method",
|
|
299
|
+
"Properties": {
|
|
307
300
|
"AuthorizationType": "AWS_IAM",
|
|
301
|
+
"HttpMethod": "DELETE",
|
|
308
302
|
"Integration": {
|
|
309
303
|
"Credentials": {
|
|
310
304
|
"Fn::GetAtt": [
|
|
@@ -374,23 +368,20 @@
|
|
|
374
368
|
},
|
|
375
369
|
"StatusCode": "500"
|
|
376
370
|
}
|
|
377
|
-
]
|
|
371
|
+
],
|
|
372
|
+
"ResourceId": {
|
|
373
|
+
"Ref": "testapigatewaydynamodbRestApiid78018D34"
|
|
374
|
+
},
|
|
375
|
+
"RestApiId": {
|
|
376
|
+
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
377
|
+
}
|
|
378
378
|
}
|
|
379
379
|
},
|
|
380
380
|
"testapigatewaydynamodbRestApiPOSTE99BD0BD": {
|
|
381
381
|
"Type": "AWS::ApiGateway::Method",
|
|
382
382
|
"Properties": {
|
|
383
|
-
"HttpMethod": "POST",
|
|
384
|
-
"ResourceId": {
|
|
385
|
-
"Fn::GetAtt": [
|
|
386
|
-
"testapigatewaydynamodbRestApi80489300",
|
|
387
|
-
"RootResourceId"
|
|
388
|
-
]
|
|
389
|
-
},
|
|
390
|
-
"RestApiId": {
|
|
391
|
-
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
392
|
-
},
|
|
393
383
|
"AuthorizationType": "AWS_IAM",
|
|
384
|
+
"HttpMethod": "POST",
|
|
394
385
|
"Integration": {
|
|
395
386
|
"Credentials": {
|
|
396
387
|
"Fn::GetAtt": [
|
|
@@ -460,7 +451,16 @@
|
|
|
460
451
|
},
|
|
461
452
|
"StatusCode": "500"
|
|
462
453
|
}
|
|
463
|
-
]
|
|
454
|
+
],
|
|
455
|
+
"ResourceId": {
|
|
456
|
+
"Fn::GetAtt": [
|
|
457
|
+
"testapigatewaydynamodbRestApi80489300",
|
|
458
|
+
"RootResourceId"
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
"RestApiId": {
|
|
462
|
+
"Ref": "testapigatewaydynamodbRestApi80489300"
|
|
463
|
+
}
|
|
464
464
|
}
|
|
465
465
|
},
|
|
466
466
|
"testapigatewaydynamodbRestApiUsagePlan244F06C8": {
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
// Setup
|
|
20
|
+
const app = new aws_cdk_lib_1.App();
|
|
21
|
+
const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
|
|
22
|
+
stack.templateOptions.description = 'Integration Test for aws-apigateway-dynamodb';
|
|
23
|
+
// Definitions
|
|
24
|
+
const props = {
|
|
25
|
+
allowReadOperation: true,
|
|
26
|
+
allowCreateOperation: true,
|
|
27
|
+
allowDeleteOperation: true,
|
|
28
|
+
allowUpdateOperation: true,
|
|
29
|
+
createRequestTemplate: "{\r\n \"TableName\": \"${Table}\",\r\n \"Item\": {\r\n \"id\": {\r\n \"S\": \"$input.path('$.id')\"\r\n },\r\n \"EventCount\": {\r\n \"N\": \"$input.path('$.EventCount')\"\r\n },\r\n \"Message\": {\r\n \"S\": \"$input.path('$.Message')\"\r\n }\r\n }\r\n}",
|
|
30
|
+
updateRequestTemplate: "{\r\n \"TableName\": \"${Table}\",\r\n \"Key\": {\r\n \"id\": {\r\n \"S\": \"$input.path('$.id')\"\r\n }\r\n },\r\n \"ExpressionAttributeValues\": {\r\n \":event_count\": {\r\n \"N\": \"$input.path('$.EventCount')\"\r\n },\r\n \":message\": {\r\n \"S\": \"$input.path('$.Message')\"\r\n }\r\n },\r\n \"UpdateExpression\": \"ADD EventCount :event_count SET Message = :message\",\r\n \"ReturnValues\": \"ALL_NEW\"\r\n}"
|
|
31
|
+
};
|
|
32
|
+
new lib_1.ApiGatewayToDynamoDB(stack, 'test-api-gateway-dynamodb', props);
|
|
33
|
+
// Synth
|
|
34
|
+
app.synth();
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuYXBpZGRiLWFwaWdhdGV3YXktZHluYW1vZGItQ1JVRC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImludGVnLmFwaWRkYi1hcGlnYXRld2F5LWR5bmFtb2RiLUNSVUQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7OztHQVdHOztBQUVILFVBQVU7QUFDViw2Q0FBeUM7QUFDekMsZ0NBQXlFO0FBQ3pFLHlEQUF3RTtBQUV4RSxRQUFRO0FBQ1IsTUFBTSxHQUFHLEdBQUcsSUFBSSxpQkFBRyxFQUFFLENBQUM7QUFDdEIsTUFBTSxLQUFLLEdBQUcsSUFBSSxtQkFBSyxDQUFDLEdBQUcsRUFBRSw2QkFBc0IsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBQ2pFLEtBQUssQ0FBQyxlQUFlLENBQUMsV0FBVyxHQUFHLD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Y291bnQgU0VUIE1lc3NhZ2UgPSA6bWVzc2FnZVxcXCIsXFxyXFxuICBcXFwiUmV0dXJuVmFsdWVzXFxcIjogXFxcIkFMTF9ORVdcXFwiXFxyXFxufVwiXG59O1xuXG5uZXcgQXBpR2F0ZXdheVRvRHluYW1vREIoc3RhY2ssICd0ZXN0LWFwaS1nYXRld2F5LWR5bmFtb2RiJywgcHJvcHMpO1xuXG4vLyBTeW50aFxuYXBwLnN5bnRoKCk7Il19
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
"existingtableE51CCC93": {
|
|
5
5
|
"Type": "AWS::DynamoDB::Table",
|
|
6
6
|
"Properties": {
|
|
7
|
-
"
|
|
7
|
+
"AttributeDefinitions": [
|
|
8
8
|
{
|
|
9
9
|
"AttributeName": "oddName",
|
|
10
|
-
"
|
|
10
|
+
"AttributeType": "S"
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
|
-
"
|
|
13
|
+
"BillingMode": "PAY_PER_REQUEST",
|
|
14
|
+
"KeySchema": [
|
|
14
15
|
{
|
|
15
16
|
"AttributeName": "oddName",
|
|
16
|
-
"
|
|
17
|
+
"KeyType": "HASH"
|
|
17
18
|
}
|
|
18
19
|
],
|
|
19
|
-
"BillingMode": "PAY_PER_REQUEST",
|
|
20
20
|
"PointInTimeRecoverySpecification": {
|
|
21
21
|
"PointInTimeRecoveryEnabled": true
|
|
22
22
|
},
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"testapigatewaydynamodbdefaultRestApiDeploymentFAC726F35a5f302579207081dccaeca1e34daf59": {
|
|
61
61
|
"Type": "AWS::ApiGateway::Deployment",
|
|
62
62
|
"Properties": {
|
|
63
|
+
"Description": "Automatically created by the RestApi construct",
|
|
63
64
|
"RestApiId": {
|
|
64
65
|
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
65
|
-
}
|
|
66
|
-
"Description": "Automatically created by the RestApi construct"
|
|
66
|
+
}
|
|
67
67
|
},
|
|
68
68
|
"DependsOn": [
|
|
69
69
|
"testapigatewaydynamodbdefaultRestApioddNameGET9FAAF1BB",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"rules_to_suppress": [
|
|
75
75
|
{
|
|
76
76
|
"id": "W45",
|
|
77
|
-
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag
|
|
77
|
+
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource"
|
|
78
78
|
}
|
|
79
79
|
]
|
|
80
80
|
}
|
|
@@ -83,9 +83,6 @@
|
|
|
83
83
|
"testapigatewaydynamodbdefaultRestApiDeploymentStageprod7834D304": {
|
|
84
84
|
"Type": "AWS::ApiGateway::Stage",
|
|
85
85
|
"Properties": {
|
|
86
|
-
"RestApiId": {
|
|
87
|
-
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
88
|
-
},
|
|
89
86
|
"AccessLogSetting": {
|
|
90
87
|
"DestinationArn": {
|
|
91
88
|
"Fn::GetAtt": [
|
|
@@ -106,6 +103,9 @@
|
|
|
106
103
|
"ResourcePath": "/*"
|
|
107
104
|
}
|
|
108
105
|
],
|
|
106
|
+
"RestApiId": {
|
|
107
|
+
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
108
|
+
},
|
|
109
109
|
"StageName": "prod",
|
|
110
110
|
"TracingEnabled": true
|
|
111
111
|
}
|
|
@@ -128,14 +128,8 @@
|
|
|
128
128
|
"testapigatewaydynamodbdefaultRestApioddNameGET9FAAF1BB": {
|
|
129
129
|
"Type": "AWS::ApiGateway::Method",
|
|
130
130
|
"Properties": {
|
|
131
|
-
"HttpMethod": "GET",
|
|
132
|
-
"ResourceId": {
|
|
133
|
-
"Ref": "testapigatewaydynamodbdefaultRestApioddName392BDAEE"
|
|
134
|
-
},
|
|
135
|
-
"RestApiId": {
|
|
136
|
-
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
137
|
-
},
|
|
138
131
|
"AuthorizationType": "AWS_IAM",
|
|
132
|
+
"HttpMethod": "GET",
|
|
139
133
|
"Integration": {
|
|
140
134
|
"Credentials": {
|
|
141
135
|
"Fn::GetAtt": [
|
|
@@ -205,7 +199,13 @@
|
|
|
205
199
|
},
|
|
206
200
|
"StatusCode": "500"
|
|
207
201
|
}
|
|
208
|
-
]
|
|
202
|
+
],
|
|
203
|
+
"ResourceId": {
|
|
204
|
+
"Ref": "testapigatewaydynamodbdefaultRestApioddName392BDAEE"
|
|
205
|
+
},
|
|
206
|
+
"RestApiId": {
|
|
207
|
+
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
208
|
+
}
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
"testapigatewaydynamodbdefaultRestApiUsagePlanA266BB3D": {
|
|
@@ -0,0 +1,42 @@
|
|
|
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 dynamodb = require("aws-cdk-lib/aws-dynamodb");
|
|
19
|
+
const aws_dynamodb_1 = require("aws-cdk-lib/aws-dynamodb");
|
|
20
|
+
const core_1 = require("@aws-solutions-constructs/core");
|
|
21
|
+
// Setup
|
|
22
|
+
const app = new aws_cdk_lib_1.App();
|
|
23
|
+
const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
|
|
24
|
+
stack.templateOptions.description = 'Integration Test for aws-apigateway-dynamodb';
|
|
25
|
+
const oddPartitionKeyName = 'oddName';
|
|
26
|
+
const table = new dynamodb.Table(stack, 'existing-table', {
|
|
27
|
+
partitionKey: {
|
|
28
|
+
name: oddPartitionKeyName,
|
|
29
|
+
type: dynamodb.AttributeType.STRING,
|
|
30
|
+
},
|
|
31
|
+
pointInTimeRecovery: true,
|
|
32
|
+
encryption: dynamodb.TableEncryption.AWS_MANAGED,
|
|
33
|
+
billingMode: aws_dynamodb_1.BillingMode.PAY_PER_REQUEST
|
|
34
|
+
});
|
|
35
|
+
// Definitions
|
|
36
|
+
const props = {
|
|
37
|
+
existingTableObj: table,
|
|
38
|
+
};
|
|
39
|
+
new lib_1.ApiGatewayToDynamoDB(stack, 'test-api-gateway-dynamodb-default', props);
|
|
40
|
+
// Synth
|
|
41
|
+
app.synth();
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuYXBpZGRiLWFwaWdhdGV3YXktZHluYW1vZGItZXhpc3RpbmctdGFibGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbnRlZy5hcGlkZGItYXBpZ2F0ZXdheS1keW5hbW9kYi1leGlzdGluZy10YWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7O0dBV0c7O0FBRUgsVUFBVTtBQUNWLDZDQUF5QztBQUN6QyxnQ0FBeUU7QUFDekUscURBQXFEO0FBQ3JELDJEQUF1RDtBQUN2RCx5REFBd0U7QUFFeEUsUUFBUTtBQUNSLE1BQU0sR0FBRyxHQUFHLElBQUksaUJBQUcsRUFBRSxDQUFDO0FBQ3RCLE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
10
|
-
"
|
|
10
|
+
"AttributeType": "S"
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
|
-
"
|
|
13
|
+
"BillingMode": "PAY_PER_REQUEST",
|
|
14
|
+
"KeySchema": [
|
|
14
15
|
{
|
|
15
16
|
"AttributeName": "id",
|
|
16
|
-
"
|
|
17
|
+
"KeyType": "HASH"
|
|
17
18
|
}
|
|
18
19
|
],
|
|
19
|
-
"BillingMode": "PAY_PER_REQUEST",
|
|
20
20
|
"PointInTimeRecoverySpecification": {
|
|
21
21
|
"PointInTimeRecoveryEnabled": true
|
|
22
22
|
},
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"testapigatewaydynamodbadditionalrequesttemplatesRestApiDeployment0AE7C47761b8949a9247c12493c939f05e630c9d": {
|
|
61
61
|
"Type": "AWS::ApiGateway::Deployment",
|
|
62
62
|
"Properties": {
|
|
63
|
+
"Description": "Automatically created by the RestApi construct",
|
|
63
64
|
"RestApiId": {
|
|
64
65
|
"Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
|
|
65
|
-
}
|
|
66
|
-
"Description": "Automatically created by the RestApi construct"
|
|
66
|
+
}
|
|
67
67
|
},
|
|
68
68
|
"DependsOn": [
|
|
69
69
|
"testapigatewaydynamodbadditionalrequesttemplatesRestApiidGET05129D15",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"rules_to_suppress": [
|
|
75
75
|
{
|
|
76
76
|
"id": "W45",
|
|
77
|
-
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag
|
|
77
|
+
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource"
|
|
78
78
|
}
|
|
79
79
|
]
|
|
80
80
|
}
|
|
@@ -83,9 +83,6 @@
|
|
|
83
83
|
"testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23": {
|
|
84
84
|
"Type": "AWS::ApiGateway::Stage",
|
|
85
85
|
"Properties": {
|
|
86
|
-
"RestApiId": {
|
|
87
|
-
"Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
|
|
88
|
-
},
|
|
89
86
|
"AccessLogSetting": {
|
|
90
87
|
"DestinationArn": {
|
|
91
88
|
"Fn::GetAtt": [
|
|
@@ -106,6 +103,9 @@
|
|
|
106
103
|
"ResourcePath": "/*"
|
|
107
104
|
}
|
|
108
105
|
],
|
|
106
|
+
"RestApiId": {
|
|
107
|
+
"Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
|
|
108
|
+
},
|
|
109
109
|
"StageName": "prod",
|
|
110
110
|
"TracingEnabled": true
|
|
111
111
|
}
|
|
@@ -128,14 +128,8 @@
|
|
|
128
128
|
"testapigatewaydynamodbadditionalrequesttemplatesRestApiidGET05129D15": {
|
|
129
129
|
"Type": "AWS::ApiGateway::Method",
|
|
130
130
|
"Properties": {
|
|
131
|
-
"HttpMethod": "GET",
|
|
132
|
-
"ResourceId": {
|
|
133
|
-
"Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90"
|
|
134
|
-
},
|
|
135
|
-
"RestApiId": {
|
|
136
|
-
"Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
|
|
137
|
-
},
|
|
138
131
|
"AuthorizationType": "AWS_IAM",
|
|
132
|
+
"HttpMethod": "GET",
|
|
139
133
|
"Integration": {
|
|
140
134
|
"Credentials": {
|
|
141
135
|
"Fn::GetAtt": [
|
|
@@ -205,7 +199,13 @@
|
|
|
205
199
|
},
|
|
206
200
|
"StatusCode": "500"
|
|
207
201
|
}
|
|
208
|
-
]
|
|
202
|
+
],
|
|
203
|
+
"ResourceId": {
|
|
204
|
+
"Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90"
|
|
205
|
+
},
|
|
206
|
+
"RestApiId": {
|
|
207
|
+
"Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
|
|
208
|
+
}
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
"testapigatewaydynamodbadditionalrequesttemplatesRestApiUsagePlan905D10C7": {
|
|
@@ -0,0 +1,48 @@
|
|
|
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 = 'id';
|
|
25
|
+
const existingTableObj = new dynamodb.Table(stack, 'existing-table', {
|
|
26
|
+
partitionKey: {
|
|
27
|
+
name: partitionKeyName,
|
|
28
|
+
type: dynamodb.AttributeType.STRING,
|
|
29
|
+
},
|
|
30
|
+
pointInTimeRecovery: true,
|
|
31
|
+
encryption: dynamodb.TableEncryption.AWS_MANAGED,
|
|
32
|
+
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST
|
|
33
|
+
});
|
|
34
|
+
new lib_1.ApiGatewayToDynamoDB(stack, 'test-api-gateway-dynamodb-additional-request-templates', {
|
|
35
|
+
existingTableObj,
|
|
36
|
+
allowCreateOperation: true,
|
|
37
|
+
createIntegrationResponses: [
|
|
38
|
+
{
|
|
39
|
+
statusCode: '200',
|
|
40
|
+
responseTemplates: {
|
|
41
|
+
'text/html': 'OK'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
// Synth
|
|
47
|
+
app.synth();
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuYXBpZGRiLWN1c3RvbS1pbnRlZ3JhdGlvbi1yZXNwb25zZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbnRlZy5hcGlkZGItY3VzdG9tLWludGVncmF0aW9uLXJlc3BvbnNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7O0dBV0c7O0FBRUgsVUFBVTtBQUNWLDZDQUF5QztBQUN6QyxnQ0FBOEM7QUFDOUMseURBQXdFO0FBQ3hFLHFEQUFxRDtBQUVyRCxRQUFRO0FBQ1IsTUFBTSxHQUFHLEdBQUcsSUFBSSxpQkFBRyxFQUFFLENBQUM7QUFDdEIsTUFBTSxLQUFLLEdBQUcsSUFBSSxtQkFBSyxDQUFDLEdBQUcsRUFBRSw2QkFBc0IsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBQ2pFLEtBQUssQ0FBQyxlQUFlLENBQUMsV0FBVyxHQUFHLDhDQUE4QyxDQUFDO0FBRW5GLE1BQU0sZ0JBQWdCLEdBQUcsSUFBSSxDQUFDO0FBRTlCLE1BQU0sZ0JBQWdCLEdBQUcsSUFBSSxRQUFRLENBQUMsS0FBSyxDQUFDLEtBQUssRUFBRSxnQkFBZ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aywgJ2V4aXN0aW5nLXRhYmxlJywge1xuICBwYXJ0aXRpb25LZXk6IHtcbiAgICBuYW1lOiBwYXJ0aXRpb25LZXlOYW1lLFxuICAgIHR5cGU6IGR5bmFtb2RiLkF0dHJpYnV0ZVR5cGUuU1RSSU5HLFxuICB9LFxuICBwb2ludEluVGltZVJlY292ZXJ5OiB0cnVlLFxuICBlbmNyeXB0aW9uOiBkeW5hbW9kYi5UYWJsZUVuY3J5cHRpb24uQVdTX01BTkFHRUQsXG4gIGJpbGxpbmdNb2RlOiBkeW5hbW9kYi5CaWxsaW5nTW9kZS5QQVlfUEVSX1JFUVVFU1Rcbn0pO1xuXG5uZXcgQXBpR2F0ZXdheVRvRHluYW1vREIoc3RhY2ssICd0ZXN0LWFwaS1nYXRld2F5LWR5bmFtb2RiLWFkZGl0aW9uYWwtcmVxdWVzdC10ZW1wbGF0ZXMnLCB7XG4gIGV4aXN0aW5nVGFibGVPYmosXG4gIGFsbG93Q3JlYXRlT3BlcmF0aW9uOiB0cnVlLFxuICBjcmVhdGVJbnRlZ3JhdGlvblJlc3BvbnNlczogW1xuICAgIHtcbiAgICAgIHN0YXR1c0NvZGU6ICcyMDAnLFxuICAgICAgcmVzcG9uc2VUZW1wbGF0ZXM6IHtcbiAgICAgICAgJ3RleHQvaHRtbCc6ICdPSydcbiAgICAgIH1cbiAgICB9XG4gIF1cbn0pO1xuXG4vLyBTeW50aFxuYXBwLnN5bnRoKCk7Il19
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
"testapigatewaydynamodbdefaultDynamoTable0720D92C": {
|
|
5
5
|
"Type": "AWS::DynamoDB::Table",
|
|
6
6
|
"Properties": {
|
|
7
|
-
"
|
|
7
|
+
"AttributeDefinitions": [
|
|
8
8
|
{
|
|
9
9
|
"AttributeName": "id",
|
|
10
|
-
"
|
|
10
|
+
"AttributeType": "S"
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
|
-
"
|
|
13
|
+
"BillingMode": "PAY_PER_REQUEST",
|
|
14
|
+
"KeySchema": [
|
|
14
15
|
{
|
|
15
16
|
"AttributeName": "id",
|
|
16
|
-
"
|
|
17
|
+
"KeyType": "HASH"
|
|
17
18
|
}
|
|
18
19
|
],
|
|
19
|
-
"BillingMode": "PAY_PER_REQUEST",
|
|
20
20
|
"PointInTimeRecoverySpecification": {
|
|
21
21
|
"PointInTimeRecoveryEnabled": true
|
|
22
22
|
},
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"testapigatewaydynamodbdefaultRestApiDeploymentFAC726F3818e0ad130f9a49152a4afbd35ada7b6": {
|
|
61
61
|
"Type": "AWS::ApiGateway::Deployment",
|
|
62
62
|
"Properties": {
|
|
63
|
+
"Description": "Automatically created by the RestApi construct",
|
|
63
64
|
"RestApiId": {
|
|
64
65
|
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
65
|
-
}
|
|
66
|
-
"Description": "Automatically created by the RestApi construct"
|
|
66
|
+
}
|
|
67
67
|
},
|
|
68
68
|
"DependsOn": [
|
|
69
69
|
"testapigatewaydynamodbdefaultRestApiidGET94B6F433",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"rules_to_suppress": [
|
|
75
75
|
{
|
|
76
76
|
"id": "W45",
|
|
77
|
-
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag
|
|
77
|
+
"reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource"
|
|
78
78
|
}
|
|
79
79
|
]
|
|
80
80
|
}
|
|
@@ -83,9 +83,6 @@
|
|
|
83
83
|
"testapigatewaydynamodbdefaultRestApiDeploymentStageprod7834D304": {
|
|
84
84
|
"Type": "AWS::ApiGateway::Stage",
|
|
85
85
|
"Properties": {
|
|
86
|
-
"RestApiId": {
|
|
87
|
-
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
88
|
-
},
|
|
89
86
|
"AccessLogSetting": {
|
|
90
87
|
"DestinationArn": {
|
|
91
88
|
"Fn::GetAtt": [
|
|
@@ -106,6 +103,9 @@
|
|
|
106
103
|
"ResourcePath": "/*"
|
|
107
104
|
}
|
|
108
105
|
],
|
|
106
|
+
"RestApiId": {
|
|
107
|
+
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
108
|
+
},
|
|
109
109
|
"StageName": "prod",
|
|
110
110
|
"TracingEnabled": true
|
|
111
111
|
}
|
|
@@ -128,14 +128,8 @@
|
|
|
128
128
|
"testapigatewaydynamodbdefaultRestApiidGET94B6F433": {
|
|
129
129
|
"Type": "AWS::ApiGateway::Method",
|
|
130
130
|
"Properties": {
|
|
131
|
-
"HttpMethod": "GET",
|
|
132
|
-
"ResourceId": {
|
|
133
|
-
"Ref": "testapigatewaydynamodbdefaultRestApiidFD6A9E91"
|
|
134
|
-
},
|
|
135
|
-
"RestApiId": {
|
|
136
|
-
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
137
|
-
},
|
|
138
131
|
"AuthorizationType": "AWS_IAM",
|
|
132
|
+
"HttpMethod": "GET",
|
|
139
133
|
"Integration": {
|
|
140
134
|
"Credentials": {
|
|
141
135
|
"Fn::GetAtt": [
|
|
@@ -205,7 +199,13 @@
|
|
|
205
199
|
},
|
|
206
200
|
"StatusCode": "500"
|
|
207
201
|
}
|
|
208
|
-
]
|
|
202
|
+
],
|
|
203
|
+
"ResourceId": {
|
|
204
|
+
"Ref": "testapigatewaydynamodbdefaultRestApiidFD6A9E91"
|
|
205
|
+
},
|
|
206
|
+
"RestApiId": {
|
|
207
|
+
"Ref": "testapigatewaydynamodbdefaultRestApi9102FDF9"
|
|
208
|
+
}
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
"testapigatewaydynamodbdefaultRestApiUsagePlanA266BB3D": {
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
// Setup
|
|
20
|
+
const app = new aws_cdk_lib_1.App();
|
|
21
|
+
const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
|
|
22
|
+
stack.templateOptions.description = 'Integration Test for aws-apigateway-dynamodb';
|
|
23
|
+
// Definitions
|
|
24
|
+
const props = {};
|
|
25
|
+
new lib_1.ApiGatewayToDynamoDB(stack, 'test-api-gateway-dynamodb-default', props);
|
|
26
|
+
// Synth
|
|
27
|
+
app.synth();
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuYXBpZGRiLW5vLWFyZ3VtZW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImludGVnLmFwaWRkYi1uby1hcmd1bWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7OztHQVdHOztBQUVILFVBQVU7QUFDViw2Q0FBeUM7QUFDekMsZ0NBQXlFO0FBQ3pFLHlEQUF3RTtBQUV4RSxRQUFRO0FBQ1IsTUFBTSxHQUF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