DEV Community

Cover image for ๐Ÿš€ Amazon ECS Now Supports Updating Capacity Providers Without Recreating Services
Latchu@DevOps
Latchu@DevOps

Posted on

๐Ÿš€ Amazon ECS Now Supports Updating Capacity Providers Without Recreating Services

๐Ÿ†• What's New?

Amazon ECS just made life easier for container users!

You can now update the capacity provider configuration of an existing ECS service without needing to recreate the service. This means you can seamlessly switch between EC2 and Fargate, or even balance across both โ€” all without service disruption.


๐Ÿ’ก Why It Matters

Before this update:

  • You had to recreate your ECS service to switch capacity providers.
  • That meant: reconfiguring load balancers, updating pipelines, and risking downtime.

Now:

  • Simply use the UpdateService API or AWS Console to switch providers.
  • Zero service recreation. Zero downtime.

๐Ÿงช Example Use Case

Say your ECS service web-api-service is currently running on EC2.

You now want to shift to Fargate to reduce infra management.

You can run this:

aws ecs update-service \
  --cluster my-cluster \
  --service web-api-service \
  --capacity-provider-strategy capacityProvider=FARGATE,weight=1

Enter fullscreen mode Exit fullscreen mode

โžก๏ธ Done! Your service will begin replacing EC2 tasks with Fargate tasks smoothly.

You can also mix both:

--capacity-provider-strategy capacityProvider=FARGATE,weight=1 capacityProvider=EC2,weight=1

Enter fullscreen mode Exit fullscreen mode

This splits traffic 50/50 between EC2 and Fargate.


โš™๏ธ Works With:

  • ๐ŸŸฆ EC2 Auto Scaling groups
  • ๐ŸŸฉ AWS Fargate
  • ๐Ÿ” Mixed strategies
  • ๐Ÿงฐ AWS Console or CLI

๐Ÿ” TL;DR

Old Way: Recreate service to switch compute backend (risky & manual)
New Way: Just update the capacity provider โ€” smooth, fast, and safe โœ…


๐Ÿ—ฃ๏ธ Your Turn

  • Are you planning to migrate your ECS services to Fargate?
  • Or do you use both compute types for cost control?

Let me know in the comments! ๐Ÿ‘‡

Top comments (0)