jeudi 26 février 2015

Using AWS SWF to add a simple crontab to an EB app

I've been reading up on AWS' simple workflow service all day, and I'm still confused by it. I have an Elastic Beanstalk app with a file that needs to be run once every couple hours, which I could do (and was doing) via a simple crontab inside of the .ebextensions folder. The only problem is that if the auto-scaling app scales to a single instance, it may drop the leader instance and with it the task.


My question is how to go about running this task with SWF? It's a really simple task to repeat, but even with the AWS documentation and some examples, I don't really understand how to set it up and include it in my EB app.


Previously this is what I had:


In .ebextensions/01update_hipchat.config:


container_commands: 01_cronjobs: command: "crontab .ebextensions/update_hipchat.txt"


In .ebextensions/update_hipchat.txt:


* * * * * root /usr/bin/python update_hipchat.py


(Honestly I couldn't get this to work either, but I think I should switch over to SWF anyways.)


Any help or a point in the right direction would be appreciated!





Aucun commentaire:

Enregistrer un commentaire