Reputation: 1607
Need to invoke lambda when record inserted to dynamoDB table, But here i need to invoke lambda after 60 seconds of record insertion, is there any way that invoke lambda after n seconds?
Upvotes: 4
Views: 2974
Reputation: 21540
To solve this in a "scalable" manner I would use the following AWS products:
The process would look like this:
Upvotes: 2
Reputation: 7455
You can achieve such behavior with AWS StepFunctions. There is a special "wait" state, which is used to delay before next step.
So the idea is that state machine is launched in response to a new DynamoDB record, then it transits to the "wait" step (60 sec) and then transits to a "task" step with your lambda function.
Upvotes: 1
Reputation: 7028
You could trigger a lambda that writes your DynamoDB events to a SQS Queue, which is getting polled by your initial lambda. Then you could customize the polling intervall and therefore the duration your lambda gets invoked after something was inserted into the table.
Upvotes: 0