Running AWS ECS Fargate Spot

Adrian Macal
1 min readNov 22, 2020

The AWS ECS offers nice way of running Python containers with ETL work. But spinning hundreds of containers with default settings does not uses cost effective pricing model. In non-essential work you can start bidding spots.

Infrastructure

The minimal changes in the infrastructure should be done in the way how the ECS cluster is provisioned. Here is the version which defines only Fargate Spot as default capacity provider.

Running tasks

The most important change in the code to run ECS task is to not specify launch type at all. I left Fargate there and it still ran, but I could not be able to confirm if the spot was used.

Confirmation

How to be sure if it runs as expected? In the console, in the task you should see new property describing chosen capacity.

--

--

Adrian Macal

Software Developer, Data Engineer with solid knowledge of Business Intelligence. Passionate about programming.