I'm running AWS ECS cluster with EC2 instances and I want a command to scale up the tasks to 1 running instance and then after some time when I do not need it I want to scale it down to 0. This should destroy the underlying EC2 instance to avoid charges. I'm not using Fargate as it is not in free tier.
what I'm currently using to scale up to one and start running it:
ecs-cli scale --capability-iam --size 1 --cluster myEC2clusterName --region us-east-1
aws ecs run-task --cluster myEC2clusterName --region us-east-1 --task-definition myTaskDefinitionName:1 --count 1
what I'm currently using to scale down:
ecs-cli scale --capability-iam --size 0 --cluster myEC2clusterName --region us-east-1
Is there an equivalent command only in aws cli without need to use ecs-cli to do the same?