empire
empire copied to clipboard
Support service PlacementConstraints
With the 2017-04-28 release of CloudFormation, the AWS::ECS::Service
resource now supports the PlacementConstraints
and PlacementStrategies
properties.
PlacementConstraints
seems very useful for the case where an N-task service is scheduled on an N-instance cluster. If nodes cycle, ECS will reschedule tasks to healthy instances, but won't move them back when the instances are replaced. This can leave the majority of tasks on a small number of instances, or all grouped in one AZ, which isn't great for availability. If we set PlacementConstraints
to distinctInstance
we can prevent two tasks from the same job from starting on the same container instance.