CDK Constructs for AWS DynamoDB Stream to AWS Lambda integration.
Project description
aws-dynamodb-stream-lambda module
---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/ |
---|
Language | Package |
---|---|
Python | aws_solutions_constructs.aws_dynamodb_stream_lambda |
Typescript | @aws-solutions-constructs/aws-dynamodb-stream-lambda |
Java | software.amazon.awsconstructs.services.dynamodbstreamlambda |
This AWS Solutions Construct implements a pattern Amazon DynamoDB table with stream to invoke the AWS Lambda function with the least privileged permissions.
Here is a minimal deployable pattern definition:
const { DynamoDBStreamToLambdaProps, DynamoDBStreamToLambda} = require('@aws-solutions-constructs/aws-dynamodb-stream-lambda');
const props: DynamoDBStreamToLambdaProps = {
lambdaFunctionProps: {
code: lambda.Code.asset(`${__dirname}/lambda`),
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler'
},
};
new DynamoDBStreamToLambda(stack, 'test-dynamodb-stream-lambda', props);
Initializer
new DynamoDBStreamToLambda(scope: Construct, id: string, props: DynamoDBStreamToLambdaProps);
Parameters
- scope
Construct
- id
string
- props
DynamoDBStreamToLambdaProps
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingLambdaObj? | lambda.Function |
Existing instance of Lambda Function object, if this is set then the lambdaFunctionProps is ignored. |
lambdaFunctionProps? | lambda.FunctionProps |
User provided props to override the default props for the Lambda function. |
dynamoTableProps? | dynamodb.TableProps |
Optional user provided props to override the default props for DynamoDB Table |
existingTableObj? | dynamodb.Table |
Existing instance of DynamoDB table object, If this is set then the dynamoTableProps is ignored |
dynamoEventSourceProps? | aws-lambda-event-sources.DynamoEventSourceProps |
Optional user provided props to override the default props for DynamoDB Event Source |
Pattern Properties
Name | Type | Description |
---|---|---|
dynamoTable | dynamodb.Table |
Returns an instance of dynamodb.Table created by the construct |
lambdaFunction | lambda.Function |
Returns an instance of lambda.Function created by the construct |
Default settings
Out of the box implementation of the Construct without any override will set the following defaults:
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
AWS Lambda Function
- Configure least privilege access IAM role for Lambda function
- Enable reusing connections with Keep-Alive for NodeJs Lambda function
Architecture
© Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aws-solutions-constructs.aws-dynamodb-stream-lambda-1.58.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa3198060425b2037b8ae16e5c930f8b7f05e5bec1d6d531040e5607e2e2854a |
|
MD5 | 297e3864f60424975bb2d7b26c356c21 |
|
BLAKE2b-256 | 67ea6c2b6c556222966a2ac25dc0ca975e225448670c9f3a451bbbe007bffe35 |
Hashes for aws_solutions_constructs.aws_dynamodb_stream_lambda-1.58.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd3786aa45838a10a8e25c641029c56b51c13095da0dd5a1fd3516a8515e4048 |
|
MD5 | ef89dbb8df53e48603b14ebd8466d47a |
|
BLAKE2b-256 | 581c15cff59fe43dee9540750a637459eecd3612b473c9b164c25b4a6d18b965 |