PowerDown supports the AWS Elastic Container Service (ECS), both classic EC2 where you manage your own clusters and servers, and the newer infrastructure-less Fargate.
ECS services are scalable container services that launch and manage one or more docker containers instances. An ECS service defines a desired state of how many container tasks should be active. It then drives that actual state to match the desired state.
PowerDown will discover all your ECS container services and will manage them similarly to Autoscale server groups by changing the task count in response to power up or down events.
AWS ECS defines a concept of a Task which is a collection of containers that are run as a unit. ECS Tasks are defined via Task definitions that specify the container environment and how the containers should be run. While ECS tasks are transient, an ECS service is persistent and launches and manages multiple instances of an ECS task. ECS services run on ECS clusters which can either run on your own classic EC2 servers or on ECS Fargate which is managed by AWS.
PowerDown uses ECS services as the point of management for powering up and down containers. You should define an ECS service for any ECS tasks that you wish to manage with PowerDown.
ECS Infrastructure Types
AWS Fargate is a technology for Amazon ECS that allows you to run containers without having to manage infrastructure such as servers or clusters. AWS bills Fargate container services on a per-second CPU and memory basis only while they are powered up and running. If you power Fargate containers down, you do not pay AWS anymore for those resources.
PowerDown can manage containers running on ECS using EC2 servers that you manage. In this mode, containers run on servers you create and pay for as you would any EC2 instance. Consequently, you should power up and down the server instances (or Autoscale groups) rather than the individual containers. You can power down container services to free up capacity within the EC2 instance, but you will not reduce your AWS bill.
Powering Up and Down ECS Services
When an ECS Service is powered down, the task count will be set to the defined desired task count of the service. When the service is powered up, the instance count will be set to zero. When you stop an ECS service, all currently executing tasks are terminated. When you power up, they are re-created.
PowerDown offers additional flexibility by defining a powered down state which can use a non-zero number of tasks to enable a "low-power" mode such that the service group is still available when powered down, but at a reduced capacity.
You can also specify a different task definition to use for powered up and powered down states. In this way, you can select smaller, cheaper CPU/Memory and server configurations to use when powered-down and more powerful instances when powered up.
Note: existing instances will not be re-created when transitioning from a powered down to a powered up state. Only the new task instances will use the task definition when powering up.