Quick post today about CostSaving on AWS. As you know two of my preferred subjects on Public Cloud are: Security and FinOps !

Recently, AWS introduced a way to reduce by up to 70% AWS bills using Spot instances with AWS Fargate service.

It’s really easy to use, and if your workload is interruption-proof, batch jobs, or CI/CD containers, don’t hesitate to use it to drastically reduce your workloads costs.

Using Terraform, you just have to specify the capacity_providers and/or the default_capacity_provider_strategy on your aws_ecs_cluster resource.

1
2
3
4
5
6
7
8
9
resource "aws_ecs_cluster" "ecs_cluster" {
  name               = "${var.project}_ecs_cluster_${var.env}"
  capacity_providers = ["FARGATE_SPOT"]

  default_capacity_provider_strategy {
    capacity_provider = "FARGATE_SPOT"
    weight            = "100"
  }
}

These settings seem not to be available yet on CloudFormation

That’s all folks!

zoph.