问题
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