Reputation: 5197
I want to run a delayed job/function–ideally something on AWS lambda. I saw on SQS or SNS there was an option to delay a message 15 minutes, but I want to be able to delay it up to 1 week. What's the best way to accomplish something like that?
I want to use a service like SQS or SNS. At the moment, I am considering using a non-AWS service, but that seems like it will become expensive very quickly.
The scheduled times and tasks will be arbitrary and one off. The jobs will be irregular as opposed to regular. Ideally I'd like an endpoint that I can hit with a timestamp and body and process the job at the given timestamp.
Upvotes: 5
Views: 2360
Reputation: 12420
For one-off executions seems like the only option is to use Step Functions and the Wait state which "delays the state machine from continuing for a specified time". Since delay does not have to be hard-coded, but can come from input, it sounds like exactly what you need.
Upvotes: 1
Reputation: 2209
I'm looking for something like that myself. I found this, and it seems like what you would want, but I haven't played with it at all, so I can't tell you how to do it.
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatchEvents.html#putEvents-property
Upvotes: 0
Reputation: 46879
AWS Lambda now has the ability to setup and run functions on a chron like schedule:
Upvotes: 1