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 = {
deployLambda: true,
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 |
---|---|---|
deployLambda | boolean |
Whether to create a new Lambda function or use an existing Lambda function |
existingLambdaObj? | lambda.Function |
Existing instance of Lambda Function object |
lambdaFunctionProps? | lambda.FunctionProps |
Optional user provided props to override the default props for Lambda function |
dynamoTableProps? | dynamodb.TableProps |
Optional user provided props to override the default props for DynamoDB Table |
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
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.46.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979d2978ac5a740c774c16cf9689a83c667db34dd35b61f6b03541c02d0cf366 |
|
MD5 | d50e2cdffff43fc9a4ee20e815ad8a3d |
|
BLAKE2b-256 | 16d74f99a64710831aa3c445aaa42a05dca826b7e20cb0eecf8f73195d362132 |
Hashes for aws_solutions_constructs.aws_dynamodb_stream_lambda-1.46.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ba7a9a8bb14affc2ab9d5de4901b5358ab75481527c380798d78311af4dd8c |
|
MD5 | bc4ef23ad8c2e26d1401c8af8b6747a3 |
|
BLAKE2b-256 | e8821f7ec105a975ab8e34e5163af28f039689a738ccef1096e24cbd52d891e8 |