Let’s be real, who doesn’t love saving money? We want performance, sure, but we also need to keep those costs in check. If you’re running containerized apps on AWS ECS, you might have heard the buzz about Graviton2 processors and Fargate Spot. These two technologies offer a powerful combination for cost reduction.

Hitting a Roadblock in the Console

So, you’re excited to try out Fargate Spot with those shiny new Graviton2 instances, right? But you open up the ECS console, ready to configure everything… and there’s no clear option for Fargate Spot capacity providers. It’s just the regular Fargate, staring back at you innocently. Frustrating, isn’t it?

Don’t Worry, the CLI’s Got Your Back

Fortunately, AWS provides a solution through the AWS CLI…. Here’s the lowdown on how to get Fargate Spot up and running, even if the console is playing hide-and-seek:

  1. Check It Out:
    Peek at your cluster’s current capacity providers:
    aws ecs describe-clusters --clusters <your-cluster-name> --query "clusters[0].capacityProviders"
  2. Configure Fargate Spot:
    Add both Fargate and Fargate Spot, then make Spot the default:
    aws ecs put-cluster-capacity-providers \
    --cluster \
    --capacity-providers FARGATE FARGATE_SPOT \
    --default-capacity-provider-strategy capacityProvider=FARGATE_SPOT,weight=1
  3. Double-Check:
    Make sure everything’s set up right:
    aws ecs describe-clusters --clusters --query "clusters[0].capacityProviders"

The Payoff: Why This Matters

Graviton2: Graviton2 processors deliver superior performance at a lower cost compared to traditional x86-based instances..

Fargate Spot: Fargate Spot allows you to bid on spare EC2 capacity, significantly reducing costs for fault-tolerant workloads.”

The Combo: Combining Graviton2 and Fargate Spot offers a compelling strategy for optimizing ECS costs, a move your finance team will undoubtedly appreciate.

While the AWS console currently lacks direct support for configuring Fargate Spot capacity providers, the CLI provides a straightforward solution. By executing a few simple commands, you can unlock substantial cost savings. As always, it is recommended to test any configuration changes in a non-production environment before deploying to production.

Additional Considerations

Ensure your task definitions are configured to use the ARM64 architecture, which is required for Graviton2 processors. Additionally, verify that your ECS cluster is running on platform version 1.3 or later to enable Fargate Spot functionality.”

About

With more than 20 years of experience in the technology sector, Mario has dedicated the last decade to offering consultancy, support, and strategic guidance to clients across various cloud platforms.

Disclaimer: The information shared on this blog is for informational purposes only and should not be considered as professional advice. The opinions presented here are personal and independent of any affiliations with tech companies or organizations.

Mario Tolic