-
Notifications
You must be signed in to change notification settings - Fork 420
Question: Running one-off tasks #24
Comments
Do you mean something that is repeated daily or just ad-hoc operations? Cron jobs work well for the former, you could bake it into the AMI. Depending on your use case you can also have a "worker" in the form of an ECS task that just sleeps and runs at regular intervals or a "service" that executes your commands. It's hard to tell what would be the best approach as this seems very use-case specific to me, if you wanna share more about what your needs are maybe we can come up with something interesting that could be added to stack. |
I was asking about ad-hoc operations such as running a script to fix some data, or running database migrations.... Currently, I duplicate my service task definition in terraform and omit the port mappings, then run |
That's a good solution I want to start using: seems like you just need to automate it (use terraform outputs plus the aws cli). I sometimes end up doing ssh + docker run/exec |
I use terraform's
|
I created a script for this. You will need to tweak it if you run multiple services in an ECS cluster: https://github.com/KariusDx/aws-scripts/blob/master/ecs-one-off |
How do you run one-off tasks, such as running a script or a database migration against a container/task definition?
I currently have a very similar terraform setup but I run one-off tasks through the aws cli.
The text was updated successfully, but these errors were encountered: