@barchart/aws-lambda-suppressor
v1.2.6
Published
Utilities for tracking and suppressing AWS Lambda invocations
Downloads
133
Maintainers
Keywords
Readme
@barchart/aws-lambda-suppressor
A public JavaScript package for tracking and suppressing duplicate invocations of AWS Lambda Functions.
Workflow
- Each Lambda invocation includes an
event
object. - Depending on the
event
source, a unique identifier can usually be extracted. - The
DynamoMessageValidator
saves these unique identifiers to DynamoDB (using a conditional writes). - Failure indicates another Lambda has already processed the same event and processing should be suppressed.
Usage
This package is typically used with a simple framework found in the @barchart/common-node-js library.
- First, instantiate a
LambdaEventValidator
and add aDynamoMessageValidator
instance. - Then, plug the
LambdaEventValidator
into yourLambdaHelper
by overriding itsgetValidator
function.
License
This software is provided under the MIT license.