AWS Lambda. Invoke with delay

时光毁灭记忆、已成空白 提交于 2019-12-23 15:44:54

问题


I need to build "tasks scheduler" with Amazon tools. Main problem that i need execute task once with huge delay (it may be a few hours or few weeks).

I try to research how to build it with CloudWatch and Lambda function. As i understand - i need to use separate rule for one timeout execution. But AWS allow me only 100 rules/account.

Probably i'm going wrong way and this tools not intended for my task.

Also i tried SQS, but it did't allow me to set timeout more than 15 minutes. The simplest way - use own mircoservice with crone, but i hope that it is possible to do it in cloud )

May be someone has the same issue and can share with me thoughts about the implementation of this?


回答1:


CloudWatch rules should work and you can use a cron expression for the event schedule.




回答2:


I would recommend you to use disque for delaying message/retry and apscheduler (python) for scheduling your tasks.

You can use disque as a cluster also.

You can put these two inside an ec2-machine depending on your use-case.

Let me know, if you need any help!




回答3:


You may be able to use AWS Step Functions Wait State for this. I haven't used it myself but it seems like you can define a state machine where the result of a lamdba function can be used to determine how long to wait until the next step function.

Alternatively, my API https://posthook.io is able to make HTTP POST requests to defined endpoints at specific times.



来源:https://stackoverflow.com/questions/44204525/aws-lambda-invoke-with-delay

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!