New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-solutions-constructs/aws-dynamodbstreams-lambda

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-solutions-constructs/aws-dynamodbstreams-lambda

CDK Constructs for AWS DynamoDB Streams to AWS Lambda integration.

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
279
decreased by-54.11%
Maintainers
1
Weekly downloads
 
Created
Source

aws-dynamodbstreams-lambda 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_dynamodbstreams_lambda
Typescript Logo Typescript@aws-solutions-constructs/aws-dynamodbstreams-lambda
Java Logo Javasoftware.amazon.awsconstructs.services.dynamodbstreamslambda

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 in Typescript:

import { DynamoDBStreamsToLambdaProps,  DynamoDBStreamsToLambda} from '@aws-solutions-constructs/aws-dynamodbstreams-lambda';

new DynamoDBStreamsToLambda(this, 'test-dynamodbstreams-lambda', {
  lambdaFunctionProps: {
      code: lambda.Code.fromAsset(`${__dirname}/lambda`),
      runtime: lambda.Runtime.NODEJS_14_X,
      handler: 'index.handler'
  },
});

Initializer

new DynamoDBStreamsToLambda(scope: Construct, id: string, props: DynamoDBStreamsToLambdaProps);

Parameters

Pattern Construct Props

NameTypeDescription
existingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error.
lambdaFunctionProps?lambda.FunctionPropsUser provided props to override the default props for the Lambda function.
dynamoTableProps?dynamodb.TablePropsOptional user provided props to override the default props for DynamoDB Table
existingTableInterface?dynamodb.ITableExisting instance of DynamoDB table object or interface, providing both this and dynamoTableProps will cause an error.
dynamoEventSourceProps?aws-lambda-event-sources.DynamoEventSourcePropsOptional user provided props to override the default props for DynamoDB Event Source

Pattern Properties

NameTypeDescription
dynamoTableInterfacedynamodb.ITableReturns an instance of dynamodb.ITable created by the construct
dynamoTable?dynamodb.TableReturns an instance of dynamodb.Table created by the construct. IMPORTANT: If existingTableInterface was provided in Pattern Construct Props, this property will be undefined
lambdaFunctionlambda.FunctionReturns an instance of lambda.Function created by the construct

Lambda Function

This pattern requires a lambda function that can post data into the Elasticsearch. A sample function is provided here.

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 limited privilege access IAM role for Lambda function
  • Enable reusing connections with Keep-Alive for NodeJs Lambda function
  • Enable X-Ray Tracing
  • Enable Failure-Handling features like enable bisect on function Error, set defaults for Maximum Record Age (24 hours) & Maximum Retry Attempts (500) and deploy SQS dead-letter queue as destination on failure
  • Set Environment Variables
    • AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)

Architecture

Architecture Diagram


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

Keywords

FAQs

Package last updated on 11 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc