Introducing Amazon ECS task placement policies

Posted on: Dec 29, 2016

Amazon EC2 Container Service (ECS) now supports the ability to customize the placement of tasks on container instances. Previously, you would have to write custom schedulers to filter, find, and group resources if you needed to place a task on a container instance with certain resource requirements (e.g., a specific instance type).

Now, you can customize how tasks are placed based on built-in attributes such as instance type, availability zone, or custom attributes that you define. For example, you can use attributes such as environment=production to label resources, use the list APIs to find those resources, and use the RunTask and CreateService APIs to schedule tasks on those resources. You can also use placement strategies such as bin pack and spread to further define where tasks are placed. You can chain policies together to achieve sophisticated placement capabilities without writing any code. For example, you can create a custom strategy that places tasks on g2.* instances,spreads the tasks across availability zones, and bin packs based on memory within each availability zone.

For more information about task placement policies, see the documentation. Please visit our product page for more information about Amazon EC2 Container Service.