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!
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.