Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does AWS CloudFormation support ECS Task Placement strategies?

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!

like image 581
Justin Avatar asked Jan 19 '17 03:01

Justin


People also ask

Does ECS use CloudFormation?

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.

What is placement strategy in AWS?

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.

Which component of AWS ECS is responsible for placing tasks within your cluster?

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.

What is the use of CloudFormation in AWS?

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.


1 Answers

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.

like image 169
wjordan Avatar answered Sep 21 '22 12:09

wjordan