3 ms·
Yep, I agree. If you rely on Cron/SCheduled Tasks, then you end up needing to run a server to run them. If Lambda did scheduled tasks, I'd have 1-2 boxes less i
by abrookewood 10y ago
Yep, I agree. If you rely on Cron/SCheduled Tasks, then you end up needing to run a server to run them. If Lambda did scheduled tasks, I'd have 1-2 boxes less in each environment ...
- lostcolony 10y agoNot sure based on your wording, but you -can- execute scheduled tasks with Lambda. It's a little tricky, as the actual configuration takes place in Cloudwatch (Cloudwatch Events). You also will be sure to want to set up a dead letter queue, and have that broadcast to an SNS topic that will email you, so that in the event the lambda fails, you'll be alerted.
- abrookewood 10y agoI've read about external services that will hit a SQS queue for you, but it would be a lot nicer if it was just supported natively in Lambda.
- lostcolony 10y agoNo, like, http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-e... (and linked from that page, http://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html http://docs.aws.amazon.com/lambda/latest/dg/tutorial-schedul... ) You can just set up "here's my cron string, run this function", and it will run that function when applicable. No external services, no SQS. Just a Cloudwatch event, that executes your lambda, at a set schedule.
- abrookewood 10y agoPerfect! Thanks. I'm going to retire some boxes ;)
- cagataygurturk 10y agoYou can still have regular boxes but turn on them when you need and turn off when your job is over. Let's say you can turn on an instance everyday at 10pm and tell your job to turn off the instance which it runs on when the job ends. It is possible to do it via AWS API.