Does AWS CloudFormation support ECS Task Placement strategies?
I am hoping it is just not well-documented. It looks like it is only possible via the AWS CLI and the AWS Console.
If not supported, anyone know the timeline?
Thanks in advance for any insight!
Amazon ECS supports creating clusters, task definitions, services, and task sets in AWS CloudFormation. The following examples demonstrate how to create resources with these templates using the AWS CLI.
A task placement strategy is an algorithm for selecting instances for task placement or tasks for termination. Task placement strategies can be specified when either running a task or creating a new service. The task placement strategies can be updated for existing services as well.
AWS built the task placement engine, which removes the need for you to build, run, and manage your own scheduling and placement services. There are several new features that provide you with more control over how applications run across clusters through custom attributes.
AWS CloudFormation is a service that gives developers and businesses an easy way to create a collection of related AWS and third-party resources, and provision and manage them in an orderly and predictable fashion.
Yes, as of Apr 28 2017, CloudFormation supports ECS Task Placement strategies, via the PlacementStrategies
Property on the AWS::ECS::Service
Resource.
Previous answer (1/19/2017) below:
No, it appears that AWS CloudFormation's official resources do not currently support ECS Task Placement strategies.
The CloudFormation Resource corresponding to the ECS CreateService
API is AWS::ECS::Service
, which does not have a Property corresponding to CreateService
's placementStrategy
request parameter.
There is typically a lag between the introduction of new AWS product features and their support in AWS CloudFormation. ECS Task Placement was only just released on Dec 29 2016, while the ECS CloudFormation resources were only last updated in January 2016.
If you can't wait for official CloudFormation support for this new feature parameter, you could implement creating/deleting an ECS service as a Custom Resource that calls the CreateService
/DeleteService
APIs directly, e.g., in a Lambda function using the AWS SDK for NodeJS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With