I want to create an ECS cluster with two capacity providers:
- standard that uses on-demand instances
- spot, that uses spot instances
ECS is going to be linked to auto-scaling groups and handle scaling for the above providers.
When defining a service, I am going to use custom capacity provider strategy. The sample configuration could be as follow:
- base: 2 for the standard provider
- weight: 0 for the standard provider, 1 for the spot provider
If I am not mistaken, with that configuration, my service should create 2 instances on the standard (on-demand) provider, and rest on the spot one.
Assuming I want to manage 10 tasks under my service.
In the happy path, 2 of them runs on my standard provider, and 8 on the spot.
Here is the question - how is the unhappy scenario handled when spot instances are not available?
Will my service contains only 2 tasks that were placed on the on-demand instances?
If yes, how can I dynamically adjust my service to temporarily use only the on-demand provider?
Or, maybe the above configuration doesn't make any sense, and there is a better way to utilize spot instance and ECS to cut costs?