I want to stop EC2 instances after office hours to save costs. How can I do the same with ECS instances? Even if I stop all tasks/services, the instance is still there? Do I sto
You can use the "Scheduled Actions" feature of Auto Scaling Groups. Starts similar to Kerem Baydoğan's answer From EC2 Management Console:
1 Click Auto Scaling Groups from the left menu.
2 Select the group from the list.
3 Select "Scheduled Actions" from the bar that appeared in the lower middle of the screen.
4 Click on create scheduled action
5 Fill the fields as you see fit and notice that under recurrence there is also a cron option for extra flexibility.
From EC2 Management Console
After clicking save it is all done.
The Auto Scaling Group is smart enough to shut down all instances.
Yes, just stop the EC2 instance directly. When you start the instance again during office hours, the ECS agent will make the services start according to their desired value.
We are doing the same thing and it works for us.
If you have the cluster set to a minimum number of nodes with an asg. If you turn off the nodes the asg will start another node to bring it up to three minimum number of nodes. You must set the asg to zero nodes.. Then turn off the current nodes.