@aws-solutions-constructs/aws-apigateway-dynamodb 2.30.0 → 2.31.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 +274 -37
- package/README.md +25 -8
- package/lib/index.d.ts +97 -13
- package/lib/index.js +38 -22
- package/package.json +6 -6
- package/test/apigateway-dynamodb.test.js +409 -1
- package/test/integ.additional-request-templates.d.ts +13 -0
- package/test/integ.additional-request-templates.expected.json +418 -0
- package/test/integ.additional-request-templates.js +50 -0
- package/test/integ.custom-integration-responses.d.ts +13 -0
- package/test/integ.custom-integration-responses.expected.json +406 -0
- package/test/integ.custom-integration-responses.js +48 -0
package/.jsii
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"url": "https://aws.amazon.com"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@aws-solutions-constructs/core": "2.
|
|
12
|
-
"aws-cdk-lib": "^2.
|
|
11
|
+
"@aws-solutions-constructs/core": "2.31.0",
|
|
12
|
+
"aws-cdk-lib": "^2.64.0",
|
|
13
13
|
"constructs": "^10.0.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencyClosure": {
|
|
@@ -950,6 +950,19 @@
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
},
|
|
953
|
+
"aws-cdk-lib.aws_devicefarm": {
|
|
954
|
+
"targets": {
|
|
955
|
+
"dotnet": {
|
|
956
|
+
"namespace": "Amazon.CDK.AWS.DeviceFarm"
|
|
957
|
+
},
|
|
958
|
+
"java": {
|
|
959
|
+
"package": "software.amazon.awscdk.services.devicefarm"
|
|
960
|
+
},
|
|
961
|
+
"python": {
|
|
962
|
+
"module": "aws_cdk.aws_devicefarm"
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
},
|
|
953
966
|
"aws-cdk-lib.aws_devopsguru": {
|
|
954
967
|
"targets": {
|
|
955
968
|
"dotnet": {
|
|
@@ -1769,6 +1782,19 @@
|
|
|
1769
1782
|
}
|
|
1770
1783
|
}
|
|
1771
1784
|
},
|
|
1785
|
+
"aws-cdk-lib.aws_kendraranking": {
|
|
1786
|
+
"targets": {
|
|
1787
|
+
"dotnet": {
|
|
1788
|
+
"namespace": "Amazon.CDK.AWS.KendraRanking"
|
|
1789
|
+
},
|
|
1790
|
+
"java": {
|
|
1791
|
+
"package": "software.amazon.awscdk.services.kendraranking"
|
|
1792
|
+
},
|
|
1793
|
+
"python": {
|
|
1794
|
+
"module": "aws_cdk.aws_kendraranking"
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
},
|
|
1772
1798
|
"aws-cdk-lib.aws_kinesis": {
|
|
1773
1799
|
"targets": {
|
|
1774
1800
|
"dotnet": {
|
|
@@ -2250,6 +2276,19 @@
|
|
|
2250
2276
|
}
|
|
2251
2277
|
}
|
|
2252
2278
|
},
|
|
2279
|
+
"aws-cdk-lib.aws_omics": {
|
|
2280
|
+
"targets": {
|
|
2281
|
+
"dotnet": {
|
|
2282
|
+
"namespace": "Amazon.CDK.AWS.Omics"
|
|
2283
|
+
},
|
|
2284
|
+
"java": {
|
|
2285
|
+
"package": "software.amazon.awscdk.services.omics"
|
|
2286
|
+
},
|
|
2287
|
+
"python": {
|
|
2288
|
+
"module": "aws_cdk.aws_omics"
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
},
|
|
2253
2292
|
"aws-cdk-lib.aws_opensearchserverless": {
|
|
2254
2293
|
"targets": {
|
|
2255
2294
|
"dotnet": {
|
|
@@ -2874,6 +2913,19 @@
|
|
|
2874
2913
|
}
|
|
2875
2914
|
}
|
|
2876
2915
|
},
|
|
2916
|
+
"aws-cdk-lib.aws_simspaceweaver": {
|
|
2917
|
+
"targets": {
|
|
2918
|
+
"dotnet": {
|
|
2919
|
+
"namespace": "Amazon.CDK.AWS.SimSpaceWeaver"
|
|
2920
|
+
},
|
|
2921
|
+
"java": {
|
|
2922
|
+
"package": "software.amazon.awscdk.services.simspaceweaver"
|
|
2923
|
+
},
|
|
2924
|
+
"python": {
|
|
2925
|
+
"module": "aws_cdk.aws_simspaceweaver"
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
},
|
|
2877
2929
|
"aws-cdk-lib.aws_sns": {
|
|
2878
2930
|
"targets": {
|
|
2879
2931
|
"dotnet": {
|
|
@@ -3319,7 +3371,7 @@
|
|
|
3319
3371
|
},
|
|
3320
3372
|
"description": "CDK Constructs for AWS API Gateway and Amazon DynamoDB integration.",
|
|
3321
3373
|
"homepage": "https://github.com/awslabs/aws-solutions-constructs.git",
|
|
3322
|
-
"jsiiVersion": "1.
|
|
3374
|
+
"jsiiVersion": "1.74.0 (build 6d08790)",
|
|
3323
3375
|
"keywords": [
|
|
3324
3376
|
"aws",
|
|
3325
3377
|
"cdk",
|
|
@@ -3338,7 +3390,7 @@
|
|
|
3338
3390
|
},
|
|
3339
3391
|
"name": "@aws-solutions-constructs/aws-apigateway-dynamodb",
|
|
3340
3392
|
"readme": {
|
|
3341
|
-
"markdown": "# aws-apigateway-dynamodb module\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> All classes are under active development and subject to non-backward compatible changes or removal in any\n> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.\n> This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\n| **Reference Documentation**:| <span style=\"font-weight: normal\">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|\n|:-------------|:-------------|\n<div style=\"height:8px\"></div>\n\n\n| **Language** | **Package** |\n|:-------------|-----------------|\n| Python|`aws_solutions_constructs.aws_apigateway_dynamodb`|\n| Typescript|`@aws-solutions-constructs/aws-apigateway-dynamodb`|\n| Java|`software.amazon.awsconstructs.services.apigatewaydynamodb`|\n\n## Overview\nThis AWS Solutions Construct implements an Amazon API Gateway REST API connected to Amazon DynamoDB table.\n\nHere is a minimal deployable pattern definition in:\n\nTypescript\n``` typescript\nimport { Construct } from 'constructs';\nimport { Stack, StackProps } from 'aws-cdk-lib';\nimport { ApiGatewayToDynamoDBProps, ApiGatewayToDynamoDB } from \"@aws-solutions-constructs/aws-apigateway-dynamodb\";\n\nnew ApiGatewayToDynamoDB(this, 'test-api-gateway-dynamodb-default', {});\n```\n\nPython\n``` python\nfrom aws_solutions_constructs.aws_apigateway_dynamodb import ApiGatewayToDynamoDB\nfrom aws_cdk import Stack\nfrom constructs import Construct\n\nApiGatewayToDynamoDB(self, 'test-api-gateway-dynamodb-default')\n```\n\nJava\n``` java\nimport software.constructs.Construct;\n\nimport software.amazon.awscdk.Stack;\nimport software.amazon.awscdk.StackProps;\nimport software.amazon.awsconstructs.services.apigatewaydynamodb.*;\n\nnew ApiGatewayToDynamoDB(this, \"test-api-gateway-dynamodb-default\", new ApiGatewayToDynamoDBProps.Builder()\n .build());\n```\n\n## Pattern Construct Props\n\n| **Name** | **Type** | **Description** |\n|:-------------|:----------------|-----------------|\n|dynamoTableProps?|[`dynamodb.TableProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.TableProps.html)|Optional user provided props to override the default props for DynamoDB Table.|\n|existingTableObj?|[`dynamodb.Table`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.Table.html)|Existing instance of DynamoDB table object, providing both this and `dynamoTableProps` will cause an error.|\n|apiGatewayProps?|[`api.RestApiProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApiProps.html)|Optional user-provided props to override the default props for the API Gateway.|\n|allowCreateOperation?|`boolean`|Whether to deploy API Gateway Method for Create operation on DynamoDB table.|\n|createRequestTemplate?|`string`|API Gateway Request template for Create method, required if `allowCreateOperation` set to true.|\n|allowReadOperation?|`boolean`|Whether to deploy API Gateway Method for Read operation on DynamoDB table.|\n|readRequestTemplate?|`string`|Optional API Gateway Request template for Read method, it will use the default template if `allowReadOperation` is true and `readRequestTemplate` is not provided. The default template only supports a partition key and not partition + sort keys.|\n|allowUpdateOperation?|`boolean`|Whether to deploy API Gateway Method for Update operation on DynamoDB table.|\n|updateRequestTemplate?|`string`|API Gateway Request template for Update method, required if `allowUpdateOperation` set to true.|\n|allowDeleteOperation?|`boolean`|Whether to deploy API Gateway Method for Delete operation on DynamoDB table.|\n|deleteRequestTemplate?|`string`|Optional API Gateway Request template for Delete method, it will use the default template if `allowDeleteOperation` is true and `deleteRequestTemplate` is not provided. The default template only supports a partition key and not partition + sort keys.|\n|logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.|\n\n## Pattern Properties\n\n| **Name** | **Type** | **Description** |\n|:-------------|:----------------|-----------------|\n|apiGateway|[`api.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html)|Returns an instance of the api.RestApi created by the construct.|\n|apiGatewayRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for API Gateway.|\n|dynamoTable|[`dynamodb.Table`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.Table.html)|Returns an instance of dynamodb.Table created by the construct.|\n|apiGatewayCloudWatchRole?|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for API Gateway for CloudWatch access.|\n|apiGatewayLogGroup|[`logs.LogGroup`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroup.html)|Returns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch.|\n\n## Default settings\n\nOut of the box implementation of the Construct without any override will set the following defaults:\n\n### Amazon API Gateway\n* Deploy an edge-optimized API endpoint\n* Enable CloudWatch logging for API Gateway\n* Configure least privilege access IAM role for API Gateway\n* Set the default authorizationType for all API methods to IAM\n* Enable X-Ray Tracing\n\n### Amazon DynamoDB Table\n* Set the billing mode for DynamoDB Table to On-Demand (Pay per request)\n* Enable server-side encryption for DynamoDB Table using AWS managed KMS Key\n* Creates a partition key called 'id' for DynamoDB Table\n* Retain the Table when deleting the CloudFormation stack\n* Enable continuous backups and point-in-time recovery\n\n## Architecture\n\n\n***\n© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n"
|
|
3393
|
+
"markdown": "# aws-apigateway-dynamodb module\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> All classes are under active development and subject to non-backward compatible changes or removal in any\n> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.\n> This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\n| **Reference Documentation**:| <span style=\"font-weight: normal\">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|\n|:-------------|:-------------|\n<div style=\"height:8px\"></div>\n\n\n| **Language** | **Package** |\n|:-------------|-----------------|\n| Python|`aws_solutions_constructs.aws_apigateway_dynamodb`|\n| Typescript|`@aws-solutions-constructs/aws-apigateway-dynamodb`|\n| Java|`software.amazon.awsconstructs.services.apigatewaydynamodb`|\n\n## Overview\nThis AWS Solutions Construct implements an Amazon API Gateway REST API connected to Amazon DynamoDB table.\n\nHere is a minimal deployable pattern definition in:\n\nTypescript\n``` typescript\nimport { Construct } from 'constructs';\nimport { Stack, StackProps } from 'aws-cdk-lib';\nimport { ApiGatewayToDynamoDBProps, ApiGatewayToDynamoDB } from \"@aws-solutions-constructs/aws-apigateway-dynamodb\";\n\nnew ApiGatewayToDynamoDB(this, 'test-api-gateway-dynamodb-default', {});\n```\n\nPython\n``` python\nfrom aws_solutions_constructs.aws_apigateway_dynamodb import ApiGatewayToDynamoDB\nfrom aws_cdk import Stack\nfrom constructs import Construct\n\nApiGatewayToDynamoDB(self, 'test-api-gateway-dynamodb-default')\n```\n\nJava\n``` java\nimport software.constructs.Construct;\n\nimport software.amazon.awscdk.Stack;\nimport software.amazon.awscdk.StackProps;\nimport software.amazon.awsconstructs.services.apigatewaydynamodb.*;\n\nnew ApiGatewayToDynamoDB(this, \"test-api-gateway-dynamodb-default\", new ApiGatewayToDynamoDBProps.Builder()\n .build());\n```\n\n## Pattern Construct Props\n\n| **Name** | **Type** | **Description** |\n|:-------------|:----------------|-----------------|\n|dynamoTableProps?|[`dynamodb.TableProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.TableProps.html)|Optional user provided props to override the default props for DynamoDB Table.|\n|existingTableObj?|[`dynamodb.Table`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.Table.html)|Existing instance of DynamoDB table object, providing both this and `dynamoTableProps` will cause an error.|\n|apiGatewayProps?|[`api.RestApiProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApiProps.html)|Optional user-provided props to override the default props for the API Gateway.|\n|allowCreateOperation?|`boolean`|Whether to deploy an API Gateway Method for POST HTTP operations on the DynamoDB table (i.e. dynamodb:PutItem).|\n|createRequestTemplate?|`string`|API Gateway Request Template for the create method for the default `application/json` content-type. This property is required if the `allowCreateOperation` property is set to true.|\n|additionalCreateRequestTemplates?|`{ [contentType: string]: string; }`|Optional Create Request Templates for content-types other than `application/json`. Use the `createRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowCreateOperation` property is set to true.|\n|createIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the create method. This property can only be specified if the `allowCreateOperation` property is set to true.|\n|allowReadOperation?|`boolean`|Whether to deploy an API Gateway Method for GET HTTP operations on DynamoDB table (i.e. dynamodb:Query).|\n|readRequestTemplate?|`string`|API Gateway Request Template for the read method for the default `application/json` content-type. The default template only supports a partition key and not partition + sort keys.|\n|additionalReadRequestTemplates?|`{ [contentType: string]: string; }`|Optional Read Request Templates for content-types other than `application/json`. Use the `readRequestTemplate` property to set the request template for the `application/json` content-type.|\n|readIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the read method.|\n|allowUpdateOperation?|`boolean`|Whether to deploy API Gateway Method for PUT HTTP operations on DynamoDB table (i.e. dynamodb:UpdateItem).|\n|updateRequestTemplate?|`string`|API Gateway Request Template for the update method. This property is required if the `allowUpdateOperation` property is set to true.|\n|additionalUpdateRequestTemplates?|`{ [contentType: string]: string; }`|Optional Update Request Templates for content-types other than `application/json`. Use the `updateRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowUpdateOperation` property is set to true.|\n|updateIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the update method. This property can only be specified if the `allowUpdateOperation` property is set to true.|\n|allowDeleteOperation?|`boolean`|Whether to deploy API Gateway Method for DELETE HTTP operations on DynamoDB table (i.e. dynamodb:DeleteItem).|\n|deleteRequestTemplate?|`string`|API Gateway Request Template for the delete method for the default `application/json` content-type. |\n|additionalDeleteRequestTemplates?|`{ [contentType: string]: string; }`|Optional Delete request templates for content-types other than `application/json`. Use the `deleteRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowDeleteOperation` property is set to true.|\n|deleteIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the delete method. This property can only be specified if the `allowDeleteOperation` property is set to true.|\n|logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.|\n\n## Pattern Properties\n\n| **Name** | **Type** | **Description** |\n|:-------------|:----------------|-----------------|\n|apiGateway|[`api.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html)|Returns an instance of the api.RestApi created by the construct.|\n|apiGatewayRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for API Gateway.|\n|dynamoTable|[`dynamodb.Table`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.Table.html)|Returns an instance of dynamodb.Table created by the construct.|\n|apiGatewayCloudWatchRole?|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for API Gateway for CloudWatch access.|\n|apiGatewayLogGroup|[`logs.LogGroup`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroup.html)|Returns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch.|\n\n# API Gateway Request/Response Template Properties Overview\nThis construct allows you to implement four DynamoDB API operations, CREATE/READ/UPDATE/DELETE (corresponding the HTTP POST/GET/PUT/DELETE requests respectively). They are completely independent and each follows the same pattern:\n* Setting `allowCreateOperation` to true will implement the `application/json` content-type with default request and response templates\n* The request template for `application/json` requests can be customized using the `createRequestTemplate` prop value\n* *Additional* request templates can be specified using the `additionalCreateRequestTemplates` prop value. Note - these DO NOT replace the `application/json` content-type\n* Customized integration responses can be specified for any content type in the `createIntegrationResponses` prop value.\n\nSupplying any of these values without setting allowCreateOperation to true will result in an error. This pattern is the same for all four API operations.\n\n## Default settings\n\nOut of the box implementation of the Construct without any override will set the following defaults:\n\n### Amazon API Gateway\n* Deploy an edge-optimized API endpoint\n* Enable CloudWatch logging for API Gateway\n* Configure least privilege access IAM role for API Gateway\n* Set the default authorizationType for all API methods to IAM\n* Enable X-Ray Tracing\n\n### Amazon DynamoDB Table\n* Set the billing mode for DynamoDB Table to On-Demand (Pay per request)\n* Enable server-side encryption for DynamoDB Table using AWS managed KMS Key\n* Creates a partition key called 'id' for DynamoDB Table\n* Retain the Table when deleting the CloudFormation stack\n* Enable continuous backups and point-in-time recovery\n\n## Architecture\n\n\n***\n© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n"
|
|
3342
3394
|
},
|
|
3343
3395
|
"repository": {
|
|
3344
3396
|
"directory": "source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb",
|
|
@@ -3388,7 +3440,7 @@
|
|
|
3388
3440
|
},
|
|
3389
3441
|
"locationInModule": {
|
|
3390
3442
|
"filename": "lib/index.ts",
|
|
3391
|
-
"line":
|
|
3443
|
+
"line": 198
|
|
3392
3444
|
},
|
|
3393
3445
|
"parameters": [
|
|
3394
3446
|
{
|
|
@@ -3423,7 +3475,7 @@
|
|
|
3423
3475
|
"kind": "class",
|
|
3424
3476
|
"locationInModule": {
|
|
3425
3477
|
"filename": "lib/index.ts",
|
|
3426
|
-
"line":
|
|
3478
|
+
"line": 184
|
|
3427
3479
|
},
|
|
3428
3480
|
"name": "ApiGatewayToDynamoDB",
|
|
3429
3481
|
"properties": [
|
|
@@ -3431,7 +3483,7 @@
|
|
|
3431
3483
|
"immutable": true,
|
|
3432
3484
|
"locationInModule": {
|
|
3433
3485
|
"filename": "lib/index.ts",
|
|
3434
|
-
"line":
|
|
3486
|
+
"line": 187
|
|
3435
3487
|
},
|
|
3436
3488
|
"name": "apiGateway",
|
|
3437
3489
|
"type": {
|
|
@@ -3442,7 +3494,7 @@
|
|
|
3442
3494
|
"immutable": true,
|
|
3443
3495
|
"locationInModule": {
|
|
3444
3496
|
"filename": "lib/index.ts",
|
|
3445
|
-
"line":
|
|
3497
|
+
"line": 189
|
|
3446
3498
|
},
|
|
3447
3499
|
"name": "apiGatewayLogGroup",
|
|
3448
3500
|
"type": {
|
|
@@ -3453,7 +3505,7 @@
|
|
|
3453
3505
|
"immutable": true,
|
|
3454
3506
|
"locationInModule": {
|
|
3455
3507
|
"filename": "lib/index.ts",
|
|
3456
|
-
"line":
|
|
3508
|
+
"line": 186
|
|
3457
3509
|
},
|
|
3458
3510
|
"name": "apiGatewayRole",
|
|
3459
3511
|
"type": {
|
|
@@ -3464,7 +3516,7 @@
|
|
|
3464
3516
|
"immutable": true,
|
|
3465
3517
|
"locationInModule": {
|
|
3466
3518
|
"filename": "lib/index.ts",
|
|
3467
|
-
"line":
|
|
3519
|
+
"line": 185
|
|
3468
3520
|
},
|
|
3469
3521
|
"name": "dynamoTable",
|
|
3470
3522
|
"type": {
|
|
@@ -3475,7 +3527,7 @@
|
|
|
3475
3527
|
"immutable": true,
|
|
3476
3528
|
"locationInModule": {
|
|
3477
3529
|
"filename": "lib/index.ts",
|
|
3478
|
-
"line":
|
|
3530
|
+
"line": 188
|
|
3479
3531
|
},
|
|
3480
3532
|
"name": "apiGatewayCloudWatchRole",
|
|
3481
3533
|
"optional": true,
|
|
@@ -3498,20 +3550,112 @@
|
|
|
3498
3550
|
"kind": "interface",
|
|
3499
3551
|
"locationInModule": {
|
|
3500
3552
|
"filename": "lib/index.ts",
|
|
3501
|
-
"line":
|
|
3553
|
+
"line": 27
|
|
3502
3554
|
},
|
|
3503
3555
|
"name": "ApiGatewayToDynamoDBProps",
|
|
3504
3556
|
"properties": [
|
|
3557
|
+
{
|
|
3558
|
+
"abstract": true,
|
|
3559
|
+
"docs": {
|
|
3560
|
+
"default": "- None",
|
|
3561
|
+
"remarks": "Use the `createRequestTemplate` property to set the request template for the `application/json` content-type.\nThis property can only be specified if the `allowCreateOperation` property is set to true.",
|
|
3562
|
+
"summary": "Optional Create Request Templates for content-types other than `application/json`."
|
|
3563
|
+
},
|
|
3564
|
+
"immutable": true,
|
|
3565
|
+
"locationInModule": {
|
|
3566
|
+
"filename": "lib/index.ts",
|
|
3567
|
+
"line": 66
|
|
3568
|
+
},
|
|
3569
|
+
"name": "additionalCreateRequestTemplates",
|
|
3570
|
+
"optional": true,
|
|
3571
|
+
"type": {
|
|
3572
|
+
"collection": {
|
|
3573
|
+
"elementtype": {
|
|
3574
|
+
"primitive": "string"
|
|
3575
|
+
},
|
|
3576
|
+
"kind": "map"
|
|
3577
|
+
}
|
|
3578
|
+
}
|
|
3579
|
+
},
|
|
3580
|
+
{
|
|
3581
|
+
"abstract": true,
|
|
3582
|
+
"docs": {
|
|
3583
|
+
"default": "- None",
|
|
3584
|
+
"remarks": "Use the `deleteRequestTemplate` property to set the request template for the `application/json` content-type.\nThis property can only be specified if the `allowDeleteOperation` property is set to true.",
|
|
3585
|
+
"summary": "Optional Delete request templates for content-types other than `application/json`."
|
|
3586
|
+
},
|
|
3587
|
+
"immutable": true,
|
|
3588
|
+
"locationInModule": {
|
|
3589
|
+
"filename": "lib/index.ts",
|
|
3590
|
+
"line": 165
|
|
3591
|
+
},
|
|
3592
|
+
"name": "additionalDeleteRequestTemplates",
|
|
3593
|
+
"optional": true,
|
|
3594
|
+
"type": {
|
|
3595
|
+
"collection": {
|
|
3596
|
+
"elementtype": {
|
|
3597
|
+
"primitive": "string"
|
|
3598
|
+
},
|
|
3599
|
+
"kind": "map"
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
},
|
|
3603
|
+
{
|
|
3604
|
+
"abstract": true,
|
|
3605
|
+
"docs": {
|
|
3606
|
+
"default": "- None",
|
|
3607
|
+
"remarks": "Use the `readRequestTemplate` property to set the request template for the `application/json` content-type.",
|
|
3608
|
+
"summary": "Optional Read Request Templates for content-types other than `application/json`."
|
|
3609
|
+
},
|
|
3610
|
+
"immutable": true,
|
|
3611
|
+
"locationInModule": {
|
|
3612
|
+
"filename": "lib/index.ts",
|
|
3613
|
+
"line": 102
|
|
3614
|
+
},
|
|
3615
|
+
"name": "additionalReadRequestTemplates",
|
|
3616
|
+
"optional": true,
|
|
3617
|
+
"type": {
|
|
3618
|
+
"collection": {
|
|
3619
|
+
"elementtype": {
|
|
3620
|
+
"primitive": "string"
|
|
3621
|
+
},
|
|
3622
|
+
"kind": "map"
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
},
|
|
3626
|
+
{
|
|
3627
|
+
"abstract": true,
|
|
3628
|
+
"docs": {
|
|
3629
|
+
"default": "- None",
|
|
3630
|
+
"remarks": "Use the `updateRequestTemplate` property to set the request template for the `application/json` content-type.\nThis property can only be specified if the `allowUpdateOperation` property is set to true.",
|
|
3631
|
+
"summary": "Optional Update Request Templates for content-types other than `application/json`."
|
|
3632
|
+
},
|
|
3633
|
+
"immutable": true,
|
|
3634
|
+
"locationInModule": {
|
|
3635
|
+
"filename": "lib/index.ts",
|
|
3636
|
+
"line": 129
|
|
3637
|
+
},
|
|
3638
|
+
"name": "additionalUpdateRequestTemplates",
|
|
3639
|
+
"optional": true,
|
|
3640
|
+
"type": {
|
|
3641
|
+
"collection": {
|
|
3642
|
+
"elementtype": {
|
|
3643
|
+
"primitive": "string"
|
|
3644
|
+
},
|
|
3645
|
+
"kind": "map"
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
},
|
|
3505
3649
|
{
|
|
3506
3650
|
"abstract": true,
|
|
3507
3651
|
"docs": {
|
|
3508
3652
|
"default": "- false",
|
|
3509
|
-
"summary": "Whether to deploy API Gateway Method for
|
|
3653
|
+
"summary": "Whether to deploy an API Gateway Method for POST HTTP operations on the DynamoDB table (i.e. dynamodb:PutItem)."
|
|
3510
3654
|
},
|
|
3511
3655
|
"immutable": true,
|
|
3512
3656
|
"locationInModule": {
|
|
3513
3657
|
"filename": "lib/index.ts",
|
|
3514
|
-
"line":
|
|
3658
|
+
"line": 51
|
|
3515
3659
|
},
|
|
3516
3660
|
"name": "allowCreateOperation",
|
|
3517
3661
|
"optional": true,
|
|
@@ -3523,12 +3667,12 @@
|
|
|
3523
3667
|
"abstract": true,
|
|
3524
3668
|
"docs": {
|
|
3525
3669
|
"default": "- false",
|
|
3526
|
-
"summary": "Whether to deploy API Gateway Method for
|
|
3670
|
+
"summary": "Whether to deploy API Gateway Method for DELETE HTTP operations on DynamoDB table (i.e. dynamodb:DeleteItem)."
|
|
3527
3671
|
},
|
|
3528
3672
|
"immutable": true,
|
|
3529
3673
|
"locationInModule": {
|
|
3530
3674
|
"filename": "lib/index.ts",
|
|
3531
|
-
"line":
|
|
3675
|
+
"line": 142
|
|
3532
3676
|
},
|
|
3533
3677
|
"name": "allowDeleteOperation",
|
|
3534
3678
|
"optional": true,
|
|
@@ -3540,12 +3684,12 @@
|
|
|
3540
3684
|
"abstract": true,
|
|
3541
3685
|
"docs": {
|
|
3542
3686
|
"default": "- true",
|
|
3543
|
-
"summary": "Whether to deploy API Gateway Method for
|
|
3687
|
+
"summary": "Whether to deploy an API Gateway Method for GET HTTP operations on DynamoDB table (i.e. dynamodb:Query)."
|
|
3544
3688
|
},
|
|
3545
3689
|
"immutable": true,
|
|
3546
3690
|
"locationInModule": {
|
|
3547
3691
|
"filename": "lib/index.ts",
|
|
3548
|
-
"line":
|
|
3692
|
+
"line": 79
|
|
3549
3693
|
},
|
|
3550
3694
|
"name": "allowReadOperation",
|
|
3551
3695
|
"optional": true,
|
|
@@ -3557,12 +3701,12 @@
|
|
|
3557
3701
|
"abstract": true,
|
|
3558
3702
|
"docs": {
|
|
3559
3703
|
"default": "- false",
|
|
3560
|
-
"summary": "Whether to deploy API Gateway Method for
|
|
3704
|
+
"summary": "Whether to deploy API Gateway Method for PUT HTTP operations on DynamoDB table (i.e. dynamodb:UpdateItem)."
|
|
3561
3705
|
},
|
|
3562
3706
|
"immutable": true,
|
|
3563
3707
|
"locationInModule": {
|
|
3564
3708
|
"filename": "lib/index.ts",
|
|
3565
|
-
"line":
|
|
3709
|
+
"line": 114
|
|
3566
3710
|
},
|
|
3567
3711
|
"name": "allowUpdateOperation",
|
|
3568
3712
|
"optional": true,
|
|
@@ -3579,7 +3723,7 @@
|
|
|
3579
3723
|
"immutable": true,
|
|
3580
3724
|
"locationInModule": {
|
|
3581
3725
|
"filename": "lib/index.ts",
|
|
3582
|
-
"line":
|
|
3726
|
+
"line": 45
|
|
3583
3727
|
},
|
|
3584
3728
|
"name": "apiGatewayProps",
|
|
3585
3729
|
"optional": true,
|
|
@@ -3587,16 +3731,40 @@
|
|
|
3587
3731
|
"fqn": "aws-cdk-lib.aws_apigateway.RestApiProps"
|
|
3588
3732
|
}
|
|
3589
3733
|
},
|
|
3734
|
+
{
|
|
3735
|
+
"abstract": true,
|
|
3736
|
+
"docs": {
|
|
3737
|
+
"default": "- [{statusCode:\"200\"},{statusCode:\"500\",responseTemplates:{\"text/html\":\"Error\"},selectionPattern:\"500\"}]",
|
|
3738
|
+
"remarks": "This property can only be specified if the `allowCreateOperation` property is set to true.",
|
|
3739
|
+
"summary": "Optional, custom API Gateway Integration Response for the create method."
|
|
3740
|
+
},
|
|
3741
|
+
"immutable": true,
|
|
3742
|
+
"locationInModule": {
|
|
3743
|
+
"filename": "lib/index.ts",
|
|
3744
|
+
"line": 73
|
|
3745
|
+
},
|
|
3746
|
+
"name": "createIntegrationResponses",
|
|
3747
|
+
"optional": true,
|
|
3748
|
+
"type": {
|
|
3749
|
+
"collection": {
|
|
3750
|
+
"elementtype": {
|
|
3751
|
+
"fqn": "aws-cdk-lib.aws_apigateway.IntegrationResponse"
|
|
3752
|
+
},
|
|
3753
|
+
"kind": "array"
|
|
3754
|
+
}
|
|
3755
|
+
}
|
|
3756
|
+
},
|
|
3590
3757
|
{
|
|
3591
3758
|
"abstract": true,
|
|
3592
3759
|
"docs": {
|
|
3593
3760
|
"default": "- None",
|
|
3594
|
-
"
|
|
3761
|
+
"remarks": "This property is required if the `allowCreateOperation` property is set to true.",
|
|
3762
|
+
"summary": "API Gateway Request Template for the create method for the default `application/json` content-type."
|
|
3595
3763
|
},
|
|
3596
3764
|
"immutable": true,
|
|
3597
3765
|
"locationInModule": {
|
|
3598
3766
|
"filename": "lib/index.ts",
|
|
3599
|
-
"line":
|
|
3767
|
+
"line": 58
|
|
3600
3768
|
},
|
|
3601
3769
|
"name": "createRequestTemplate",
|
|
3602
3770
|
"optional": true,
|
|
@@ -3607,14 +3775,37 @@
|
|
|
3607
3775
|
{
|
|
3608
3776
|
"abstract": true,
|
|
3609
3777
|
"docs": {
|
|
3610
|
-
"default": "-
|
|
3611
|
-
"remarks": "
|
|
3612
|
-
"summary": "Optional API Gateway
|
|
3778
|
+
"default": "- [{statusCode:\"200\"},{statusCode:\"500\",responseTemplates:{\"text/html\":\"Error\"},selectionPattern:\"500\"}]",
|
|
3779
|
+
"remarks": "This property can only be specified if the `allowDeleteOperation` property is set to true.",
|
|
3780
|
+
"summary": "Optional, custom API Gateway Integration Response for the delete method."
|
|
3781
|
+
},
|
|
3782
|
+
"immutable": true,
|
|
3783
|
+
"locationInModule": {
|
|
3784
|
+
"filename": "lib/index.ts",
|
|
3785
|
+
"line": 172
|
|
3786
|
+
},
|
|
3787
|
+
"name": "deleteIntegrationResponses",
|
|
3788
|
+
"optional": true,
|
|
3789
|
+
"type": {
|
|
3790
|
+
"collection": {
|
|
3791
|
+
"elementtype": {
|
|
3792
|
+
"fqn": "aws-cdk-lib.aws_apigateway.IntegrationResponse"
|
|
3793
|
+
},
|
|
3794
|
+
"kind": "array"
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
},
|
|
3798
|
+
{
|
|
3799
|
+
"abstract": true,
|
|
3800
|
+
"docs": {
|
|
3801
|
+
"default": "- `{ \\\n\"TableName\": \"DYNAMODB_TABLE_NAME\", \\\n\"Key\": { \\\n\"${partitionKeyName}\": { \\\n \"S\": \"$input.params('PARTITION_KEY_NAME')\" \\\n } \\\n}, \\\n\"ReturnValues\": \"ALL_OLD\" \\\n}`",
|
|
3802
|
+
"remarks": "This property can only be specified if the `allowDeleteOperation` property is set to true.",
|
|
3803
|
+
"summary": "API Gateway Request Template for the delete method for the default `application/json` content-type."
|
|
3613
3804
|
},
|
|
3614
3805
|
"immutable": true,
|
|
3615
3806
|
"locationInModule": {
|
|
3616
3807
|
"filename": "lib/index.ts",
|
|
3617
|
-
"line":
|
|
3808
|
+
"line": 157
|
|
3618
3809
|
},
|
|
3619
3810
|
"name": "deleteRequestTemplate",
|
|
3620
3811
|
"optional": true,
|
|
@@ -3631,7 +3822,7 @@
|
|
|
3631
3822
|
"immutable": true,
|
|
3632
3823
|
"locationInModule": {
|
|
3633
3824
|
"filename": "lib/index.ts",
|
|
3634
|
-
"line":
|
|
3825
|
+
"line": 33
|
|
3635
3826
|
},
|
|
3636
3827
|
"name": "dynamoTableProps",
|
|
3637
3828
|
"optional": true,
|
|
@@ -3648,7 +3839,7 @@
|
|
|
3648
3839
|
"immutable": true,
|
|
3649
3840
|
"locationInModule": {
|
|
3650
3841
|
"filename": "lib/index.ts",
|
|
3651
|
-
"line":
|
|
3842
|
+
"line": 39
|
|
3652
3843
|
},
|
|
3653
3844
|
"name": "existingTableObj",
|
|
3654
3845
|
"optional": true,
|
|
@@ -3665,7 +3856,7 @@
|
|
|
3665
3856
|
"immutable": true,
|
|
3666
3857
|
"locationInModule": {
|
|
3667
3858
|
"filename": "lib/index.ts",
|
|
3668
|
-
"line":
|
|
3859
|
+
"line": 178
|
|
3669
3860
|
},
|
|
3670
3861
|
"name": "logGroupProps",
|
|
3671
3862
|
"optional": true,
|
|
@@ -3676,14 +3867,36 @@
|
|
|
3676
3867
|
{
|
|
3677
3868
|
"abstract": true,
|
|
3678
3869
|
"docs": {
|
|
3679
|
-
"default": "-
|
|
3870
|
+
"default": "- [{statusCode:\"200\"},{statusCode:\"500\",responseTemplates:{\"text/html\":\"Error\"},selectionPattern:\"500\"}]",
|
|
3871
|
+
"summary": "Optional, custom API Gateway Integration Response for the read method."
|
|
3872
|
+
},
|
|
3873
|
+
"immutable": true,
|
|
3874
|
+
"locationInModule": {
|
|
3875
|
+
"filename": "lib/index.ts",
|
|
3876
|
+
"line": 108
|
|
3877
|
+
},
|
|
3878
|
+
"name": "readIntegrationResponses",
|
|
3879
|
+
"optional": true,
|
|
3880
|
+
"type": {
|
|
3881
|
+
"collection": {
|
|
3882
|
+
"elementtype": {
|
|
3883
|
+
"fqn": "aws-cdk-lib.aws_apigateway.IntegrationResponse"
|
|
3884
|
+
},
|
|
3885
|
+
"kind": "array"
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
},
|
|
3889
|
+
{
|
|
3890
|
+
"abstract": true,
|
|
3891
|
+
"docs": {
|
|
3892
|
+
"default": "- `{ \\\n\"TableName\": \"DYNAMODB_TABLE_NAME\", \\\n\"KeyConditionExpression\": \"PARTITION_KEY_NAME = :v1\", \\\n\"ExpressionAttributeValues\": { \\\n\":v1\": { \\\n \"S\": \"$input.params('PARTITION_KEY_NAME')\" \\\n} \\\n} \\\n}`",
|
|
3680
3893
|
"remarks": "The default template only supports a partition key and not partition + sort keys.",
|
|
3681
|
-
"summary": "
|
|
3894
|
+
"summary": "API Gateway Request Template for the read method for the default `application/json` content-type."
|
|
3682
3895
|
},
|
|
3683
3896
|
"immutable": true,
|
|
3684
3897
|
"locationInModule": {
|
|
3685
3898
|
"filename": "lib/index.ts",
|
|
3686
|
-
"line":
|
|
3899
|
+
"line": 95
|
|
3687
3900
|
},
|
|
3688
3901
|
"name": "readRequestTemplate",
|
|
3689
3902
|
"optional": true,
|
|
@@ -3691,16 +3904,40 @@
|
|
|
3691
3904
|
"primitive": "string"
|
|
3692
3905
|
}
|
|
3693
3906
|
},
|
|
3907
|
+
{
|
|
3908
|
+
"abstract": true,
|
|
3909
|
+
"docs": {
|
|
3910
|
+
"default": "- [{statusCode:\"200\"},{statusCode:\"500\",responseTemplates:{\"text/html\":\"Error\"},selectionPattern:\"500\"}]",
|
|
3911
|
+
"remarks": "This property can only be specified if the `allowUpdateOperation` property is set to true.",
|
|
3912
|
+
"summary": "Optional, custom API Gateway Integration Response for the update method."
|
|
3913
|
+
},
|
|
3914
|
+
"immutable": true,
|
|
3915
|
+
"locationInModule": {
|
|
3916
|
+
"filename": "lib/index.ts",
|
|
3917
|
+
"line": 136
|
|
3918
|
+
},
|
|
3919
|
+
"name": "updateIntegrationResponses",
|
|
3920
|
+
"optional": true,
|
|
3921
|
+
"type": {
|
|
3922
|
+
"collection": {
|
|
3923
|
+
"elementtype": {
|
|
3924
|
+
"fqn": "aws-cdk-lib.aws_apigateway.IntegrationResponse"
|
|
3925
|
+
},
|
|
3926
|
+
"kind": "array"
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
},
|
|
3694
3930
|
{
|
|
3695
3931
|
"abstract": true,
|
|
3696
3932
|
"docs": {
|
|
3697
3933
|
"default": "- None",
|
|
3698
|
-
"
|
|
3934
|
+
"remarks": "This property is required if the `allowUpdateOperation` property is set to true.",
|
|
3935
|
+
"summary": "API Gateway Request Template for the update method."
|
|
3699
3936
|
},
|
|
3700
3937
|
"immutable": true,
|
|
3701
3938
|
"locationInModule": {
|
|
3702
3939
|
"filename": "lib/index.ts",
|
|
3703
|
-
"line":
|
|
3940
|
+
"line": 121
|
|
3704
3941
|
},
|
|
3705
3942
|
"name": "updateRequestTemplate",
|
|
3706
3943
|
"optional": true,
|
|
@@ -3712,6 +3949,6 @@
|
|
|
3712
3949
|
"symbolId": "lib/index:ApiGatewayToDynamoDBProps"
|
|
3713
3950
|
}
|
|
3714
3951
|
},
|
|
3715
|
-
"version": "2.
|
|
3716
|
-
"fingerprint": "
|
|
3952
|
+
"version": "2.31.0",
|
|
3953
|
+
"fingerprint": "JwhhHb8j0plu9esMqqJyGYwBhnnQge8RgjU3cpIv1pI="
|
|
3717
3954
|
}
|
package/README.md
CHANGED
|
@@ -65,14 +65,22 @@ new ApiGatewayToDynamoDB(this, "test-api-gateway-dynamodb-default", new ApiGatew
|
|
|
65
65
|
|dynamoTableProps?|[`dynamodb.TableProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.TableProps.html)|Optional user provided props to override the default props for DynamoDB Table.|
|
|
66
66
|
|existingTableObj?|[`dynamodb.Table`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.Table.html)|Existing instance of DynamoDB table object, providing both this and `dynamoTableProps` will cause an error.|
|
|
67
67
|
|apiGatewayProps?|[`api.RestApiProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApiProps.html)|Optional user-provided props to override the default props for the API Gateway.|
|
|
68
|
-
|allowCreateOperation?|`boolean`|Whether to deploy API Gateway Method for
|
|
69
|
-
|createRequestTemplate?|`string`|API Gateway Request
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
68
|
+
|allowCreateOperation?|`boolean`|Whether to deploy an API Gateway Method for POST HTTP operations on the DynamoDB table (i.e. dynamodb:PutItem).|
|
|
69
|
+
|createRequestTemplate?|`string`|API Gateway Request Template for the create method for the default `application/json` content-type. This property is required if the `allowCreateOperation` property is set to true.|
|
|
70
|
+
|additionalCreateRequestTemplates?|`{ [contentType: string]: string; }`|Optional Create Request Templates for content-types other than `application/json`. Use the `createRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowCreateOperation` property is set to true.|
|
|
71
|
+
|createIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the create method. This property can only be specified if the `allowCreateOperation` property is set to true.|
|
|
72
|
+
|allowReadOperation?|`boolean`|Whether to deploy an API Gateway Method for GET HTTP operations on DynamoDB table (i.e. dynamodb:Query).|
|
|
73
|
+
|readRequestTemplate?|`string`|API Gateway Request Template for the read method for the default `application/json` content-type. The default template only supports a partition key and not partition + sort keys.|
|
|
74
|
+
|additionalReadRequestTemplates?|`{ [contentType: string]: string; }`|Optional Read Request Templates for content-types other than `application/json`. Use the `readRequestTemplate` property to set the request template for the `application/json` content-type.|
|
|
75
|
+
|readIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the read method.|
|
|
76
|
+
|allowUpdateOperation?|`boolean`|Whether to deploy API Gateway Method for PUT HTTP operations on DynamoDB table (i.e. dynamodb:UpdateItem).|
|
|
77
|
+
|updateRequestTemplate?|`string`|API Gateway Request Template for the update method. This property is required if the `allowUpdateOperation` property is set to true.|
|
|
78
|
+
|additionalUpdateRequestTemplates?|`{ [contentType: string]: string; }`|Optional Update Request Templates for content-types other than `application/json`. Use the `updateRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowUpdateOperation` property is set to true.|
|
|
79
|
+
|updateIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the update method. This property can only be specified if the `allowUpdateOperation` property is set to true.|
|
|
80
|
+
|allowDeleteOperation?|`boolean`|Whether to deploy API Gateway Method for DELETE HTTP operations on DynamoDB table (i.e. dynamodb:DeleteItem).|
|
|
81
|
+
|deleteRequestTemplate?|`string`|API Gateway Request Template for the delete method for the default `application/json` content-type. |
|
|
82
|
+
|additionalDeleteRequestTemplates?|`{ [contentType: string]: string; }`|Optional Delete request templates for content-types other than `application/json`. Use the `deleteRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowDeleteOperation` property is set to true.|
|
|
83
|
+
|deleteIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the delete method. This property can only be specified if the `allowDeleteOperation` property is set to true.|
|
|
76
84
|
|logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.|
|
|
77
85
|
|
|
78
86
|
## Pattern Properties
|
|
@@ -85,6 +93,15 @@ new ApiGatewayToDynamoDB(this, "test-api-gateway-dynamodb-default", new ApiGatew
|
|
|
85
93
|
|apiGatewayCloudWatchRole?|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for API Gateway for CloudWatch access.|
|
|
86
94
|
|apiGatewayLogGroup|[`logs.LogGroup`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroup.html)|Returns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch.|
|
|
87
95
|
|
|
96
|
+
# API Gateway Request/Response Template Properties Overview
|
|
97
|
+
This construct allows you to implement four DynamoDB API operations, CREATE/READ/UPDATE/DELETE (corresponding the HTTP POST/GET/PUT/DELETE requests respectively). They are completely independent and each follows the same pattern:
|
|
98
|
+
* Setting `allowCreateOperation` to true will implement the `application/json` content-type with default request and response templates
|
|
99
|
+
* The request template for `application/json` requests can be customized using the `createRequestTemplate` prop value
|
|
100
|
+
* *Additional* request templates can be specified using the `additionalCreateRequestTemplates` prop value. Note - these DO NOT replace the `application/json` content-type
|
|
101
|
+
* Customized integration responses can be specified for any content type in the `createIntegrationResponses` prop value.
|
|
102
|
+
|
|
103
|
+
Supplying any of these values without setting allowCreateOperation to true will result in an error. This pattern is the same for all four API operations.
|
|
104
|
+
|
|
88
105
|
## Default settings
|
|
89
106
|
|
|
90
107
|
Out of the box implementation of the Construct without any override will set the following defaults:
|