Search code examples
amazon-web-servicesaws-lambdaschedulerstateless

Calling a function at specified times without a running server


Need to call a function at specific times without having a server up and running all the time

In particular, the challenge I'm facing is that we only use AWS Lambda and DynamoDB to - among other things - send a reminder to users at a time of their choice. That means we have to call a lambda function at the time the user wants to be reminded.

The time changes dynamically (depending on each user's choice) so the question is, what is a good way to set this up?

We are considering setting up a server if there's no way around it but even if we go for this solution, I lack the experience to see a good way to set this up. Any suggestions are greatly appreciated.


Solution

  • You can call your Lambda function on a scheduled event:

    http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html

    So set up your Lambda function with cron like event to wake on any interval you need, retrieve the list of alarms you need to send next, send them, mark completed alarms so they won't be triggered again.