I have a service which runs 1 task. The task takes 2 hours to run and runs daily. My ideal scenario would be this:
- I update my service to from 0 desired tasks to 1 desired task
- ECS sees that in order to run the service I need an EC2 Instance. It therefore spins up an instance to run the task.
- When the task finishes it updates the service to 0 desired tasks.
- ECS sees that I don't need the instance to run 0 tasks and turns it off
Using the ECS admin it looks like this is possible but in reality, when I scale up my service from 0->1 task, it just complains there is no instances to run the task, rather than autoscaling an instance. I set the auto scale policies of the cluster to min=0, desired=1, max=1 however it makes no difference.
I'd like to know if my ideal scenario is indeed possible, or if there is a better way to achieve this goal.
Thanks in advance,