Support MaximumBatchingWindowInSeconds parameter for DynamoDB and Kinesis triggers
See original GitHub issueThis is a Feature Proposal
Description
See https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html#stream-events
By default, Lambda invokes your function as soon as records are available in the stream. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a batch window. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires.
See https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#25200
feature: Lambda: Adds a “MaximumBatchingWindowInSeconds” parameter to event source mapping api’s. Usable by Dynamodb and Kinesis event sources.
Suggested config
functions:
preprocess:
handler: handler.preprocess
events:
- stream:
arn: arn:aws:kinesis:region:XXXXXX:stream/foo
batchSize: 100
maximumBatchingWindowInSeconds: 300
startingPosition: LATEST
Issue Analytics
- State:
- Created 4 years ago
- Reactions:24
- Comments:10 (4 by maintainers)
The syntax you’re using @loakeshbachhu is not correct, please see the docs: https://www.serverless.com/framework/docs/providers/aws/events/streams#setting-the-batchwindow
You can use this in the meantime:
https://serverless.com/framework/docs/providers/aws/guide/resources/#override-aws-cloudformation-resource