I'm trying to write a script thats stops all services in an existing cluster. To accomplish this, ECS services must be scaled down to desired state of 0 tasks So far, I managed to do this for a single service via a simple shell script example:
aws ecs update-service --cluster ${ecsClusterName} --service ${nameService} --task-definition ${taskDefinition} --desired-count 0
the problem I'm facing: how can I list all task's definitions:version linked to a giving service in a cluster and set the desired state to 0 in a loop