https://github.com/barchart/aws-lambda-suppressor
JavaScript utility for suppressing duplicate AWS Lambda invocations
https://github.com/barchart/aws-lambda-suppressor
dedupe deduplication duplicate-detection dynamodb javascript lambda public-repository serverless
Last synced: 18 days ago
JSON representation
JavaScript utility for suppressing duplicate AWS Lambda invocations
- Host: GitHub
- URL: https://github.com/barchart/aws-lambda-suppressor
- Owner: barchart
- License: other
- Created: 2019-08-28T19:02:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-10T14:18:11.000Z (about 1 year ago)
- Last Synced: 2025-04-19T22:02:48.894Z (about 1 month ago)
- Topics: dedupe, deduplication, duplicate-detection, dynamodb, javascript, lambda, public-repository, serverless
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 1
- Watchers: 16
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @barchart/aws-lambda-suppressor
[](https://github.com/barchart/aws-lambda-suppressor)
[](https://www.npmjs.com/package/@barchart/aws-lambda-suppressor)A *public* JavaScript package for tracking and suppressing duplicate invocations of [AWS Lambda Functions](https://aws.amazon.com/lambda/).
### Workflow
* Each Lambda invocation includes an ```event``` object.
* Depending on the ```event``` source, a unique identifier can usually be extracted.
* The [```DynamoMessageValidator```](./lib/dynamo/DynamoMessageValidator.js) 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](https://github.com/barchart/common-node-js) library.
* First, instantiate a [```LambdaEventValidator```](https://github.com/barchart/common-node-js/blob/master/aws/lambda/validators/LambdaEventValidator.js) and add a [```DynamoMessageValidator```](./lib/dynamo/DynamoMessageValidator.js) instance.
* Then, plug the [```LambdaEventValidator```](https://github.com/barchart/common-node-js/blob/master/aws/lambda/validators/LambdaEventValidator.js) into your [```LambdaHelper```](https://github.com/barchart/common-node-js/blob/master/aws/lambda/LambdaHelper.js) by overriding its ```getValidator``` function.### License
This software is provided under the MIT license.