0

I'm reading about the ECS spot (Fargate) and the capacity provider. In the examples, I see they always create an on-demand capacity provider e.g. 1 running task, and then a spot provider with a variable amount of tasks.

Is it possible to run one ECS task on spot --> When it goes down, use an on-demand instance till spot is back available and switch back? Or do I not understand the concept properly?

rock'n rolla
  • 1,883
  • 1
  • 13
  • 19
DenCowboy
  • 13,884
  • 38
  • 114
  • 210

1 Answers1

1

Spot instances are not meant to be used in the way you described. They are really useful for fault tolerant jobs, or to run along side on-demand instances, to ensure that your service does not go down, while removing some pressure off of the main on-demand instances (or Fargate containers)

That being said, if your service is really not that important, and you're ready to have some unavailability, you can try to hack together some Lambda function, that you can trigger at fixed interval using CloudWatch Events.

In a few steps :

This is really just if you want to play and learn, but it's not a recommended approach. I would never do this in production.

Cheers

Hakro
  • 2,625
  • 1
  • 12
  • 23