Categorygithub.com/christian-korneck/awssc-go-dist/awssolutionsconstructsawsapigatewaydynamodb/v2
modulepackage
2.2.0
Repository: https://github.com/christian-korneck/awssc-go-dist.git
Documentation: pkg.go.dev

# README

aws-apigateway-dynamodb module


Stability: Experimental

All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. 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.


Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/
LanguagePackage
Python Logo Pythonaws_solutions_constructs.aws_apigateway_dynamodb
Typescript Logo Typescript@aws-solutions-constructs/aws-apigateway-dynamodb
Java Logo Javasoftware.amazon.awsconstructs.services.apigatewaydynamodb

Overview

This AWS Solutions Construct implements an Amazon API Gateway REST API connected to Amazon DynamoDB table.

Here is a minimal deployable pattern definition in Typescript:

import { ApiGatewayToDynamoDBProps, ApiGatewayToDynamoDB } from "@aws-solutions-constructs/aws-apigateway-dynamodb";

new ApiGatewayToDynamoDB(this, 'test-api-gateway-dynamodb-default', {});

Initializer

new ApiGatewayToDynamoDB(scope: Construct, id: string, props: ApiGatewayToDynamoDBProps);

Parameters

Pattern Construct Props

NameTypeDescription
dynamoTableProps?dynamodb.TablePropsOptional user provided props to override the default props for DynamoDB Table.
existingTableObj?dynamodb.TableExisting instance of DynamoDB table object, providing both this and dynamoTableProps will cause an error.
apiGatewayProps?api.RestApiPropsOptional user-provided props to override the default props for the API Gateway.
allowCreateOperation?booleanWhether to deploy API Gateway Method for Create operation on DynamoDB table.
createRequestTemplate?stringAPI Gateway Request template for Create method, required if allowCreateOperation set to true.
allowReadOperation?booleanWhether to deploy API Gateway Method for Read operation on DynamoDB table.
readRequestTemplate?stringOptional 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.
allowUpdateOperation?booleanWhether to deploy API Gateway Method for Update operation on DynamoDB table.
updateRequestTemplate?stringAPI Gateway Request template for Update method, required if allowUpdateOperation set to true.
allowDeleteOperation?booleanWhether to deploy API Gateway Method for Delete operation on DynamoDB table.
deleteRequestTemplate?stringOptional 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.
logGroupProps?logs.LogGroupPropsUser provided props to override the default props for for the CloudWatchLogs LogGroup.

Pattern Properties

NameTypeDescription
apiGatewayapi.RestApiReturns an instance of the api.RestApi created by the construct.
apiGatewayRoleiam.RoleReturns an instance of the iam.Role created by the construct for API Gateway.
dynamoTabledynamodb.TableReturns an instance of dynamodb.Table created by the construct.
apiGatewayCloudWatchRole?iam.RoleReturns an instance of the iam.Role created by the construct for API Gateway for CloudWatch access.
apiGatewayLogGrouplogs.LogGroupReturns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch.

Default settings

Out of the box implementation of the Construct without any override will set the following defaults:

Amazon API Gateway

  • Deploy an edge-optimized API endpoint
  • Enable CloudWatch logging for API Gateway
  • Configure least privilege access IAM role for API Gateway
  • Set the default authorizationType for all API methods to IAM
  • Enable X-Ray Tracing

Amazon DynamoDB Table

  • Set the billing mode for DynamoDB Table to On-Demand (Pay per request)
  • Enable server-side encryption for DynamoDB Table using AWS managed KMS Key
  • Creates a partition key called 'id' for DynamoDB Table
  • Retain the Table when deleting the CloudFormation stack
  • Enable continuous backups and point-in-time recovery

Architecture

Architecture Diagram


© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.

# Packages

Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

# Functions

Checks if `x` is a construct.
No description provided by the author
No description provided by the author

# Structs

No description provided by the author

# Interfaces

No description provided by the author