๐ 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
โก๏ธ 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
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)