Reputation: 1
I have a question related to AWS on how to trigger a Lambda function based on time. I have a booking system where users can book a ride. I want to send an automated notification for them e.g. 10 mins from the time rider should arrive in case the rider is late. How can I trigger the lambda function to run (as an example 02:30 and the current time is 12:00)
Upvotes: 0
Views: 170
Reputation: 269284
Presumably you could have hundreds of users who need to receive notifications at any particular time. Therefore, merely triggering the Lambda function at a particular time probably isn't the way to accomplish this.
Instead, you could:
Note that the function should look for any notification that is due, even if it was for a previous time. This will handle situations where notifications were not successfully sent previously, or where the Lambda function doesn't run for some reason.
The Lambda function can be triggered on a schedule by using Amazon CloudWatch Events.
Upvotes: 4