Reputation: 83
I am trying to create a flow such that AWS DynamoDB Streams will only trigger a Lambda function when it reaches the batch size limit OR when the a specified time interval is reach, i.e. batch size is 100 and time interval is 5 minutes. Lets say there has only been 50 record updates and its only been 4 minute since the last invocation. I would like the lambda get triggered in the next minute if the record update hasn't reached 100. If it hits 100 before the next minute then trigger the lambda and reset the clock.
Ive tried using the batch size limit only. This does not work. If I do two updates it calls lambda twice.
Upvotes: 1
Views: 397
Reputation: 61
Similar Problem im trying to solve. Use CloudWatch Timer to create a trigger for the lambda every 5 minutes. So you have 2 lambda doing the same table. Make sure you have some Lock to avoid two lambda run at the same time.
Upvotes: 0