7

Background: I'm running docker-compose ecs locally and need to ensure I use Spot instances due to my hobbyist budget.

Question: How do I determine and guarantee that instances are running as Fargate Spot instances?

Evidence:

I have setup the default capacity provider strategy as FARGATE_SPOT I have both the default-created capacity providers 'FARGATE' and 'FARGATE_SPOT'

capacity providers default strategy

Burgiking
  • 71
  • 1

1 Answers1

5

You can see this in the web console when you view a specific task:

enter image description here

To find this page open click on your cluster from within ECS, then go to the "Tasks" tab and click on the task id.

You can also see this through the aws cli:

aws ecs describe-tasks --cluster <your cluster name> --tasks <your task id> | grep capacityProviderName
Yep_It's_Me
  • 4,494
  • 4
  • 43
  • 66
  • 1
    The issue is that the DescribeTasks API doesn't always provide this field (I assume if relying on the default capacity provider). So the aws cli won't have that field with the ecs describe-tasks command and it won't be shown in the console (e.g. like in this screenshot https://imgur.com/a/aBK5Bza) – Troy Ready Jul 27 '22 at 12:45
  • Interesting, it seems to be there for me. For reference I have two capacity providers specified on the cluster (https://imgur.com/lKIGgrb) and one capacity provider strategy specified on the service (https://imgur.com/ENB66ge). I'm not sure if that makes a difference though. – Yep_It's_Me Jul 28 '22 at 07:30
  • I think it is an issue with docker ecs deployment. I've updated the task manually through the aws ecs interface. I've changed it from 'launch type' and selected the 'Switch to capacity provider strategy' option. This now clearly displays FARGATE_SPOT when updating the task. I'll continue to look into the docker ecs github for issues. – Burgiking Aug 04 '22 at 12:30