Once that we have defined the ECS Cluster Capacity Providers, we can setup a default strategy. New services and tasks launched to this cluster will use this strategy by default. You can create however specific strategies different from the default for each service.
For our default capacity provider we have considered the following application requirements:
With this requirements we can set EcsSpotWorkshop cluster default capacity provider strategy, follow these steps:
Checkout the strategy configuration; it sets base=2
and weight=1
for CP-OD and weight=3
for CP-SPOT. That means, ECS first places 2 tasks (since base=2) to CP-OD and then splits the remaining tasks between CP-OD and CP-SOT in 1:3 ratio, so for every 1 task on CP-OD, 3 tasks placed on CP-SPOT.