What's the easiest way to update my ECS service when a new container is pushed to ECR?

August 5, 2025 6 answers
Asked by Jemsy
I'm trying to figure out the simplest method to automatically update my ECS service every time I push a new container to ECR. I've come across several options like Step Functions, CI/CD pipelines, and EventBridge, but I'm looking for the most straightforward solution. Since I typically use the #latest tag, I find myself needing to manually update the service or trigger a new deployment each time. Is there a more efficient way to handle this?

Answers

!reheat gently
In an ideal setup, this should be handled through CI/CD so you can maintain control over the deployment process.
Reply to this answer
volcano cross section
You could also specify a unique tag with a hash in your task definition instead of just using 'latest'. Plus, consider setting up a git sync so your stack updates automatically whenever you push changes to your git template. That way, you can manage separate branches for production, staging, and development, making deployments much smoother.
Reply to this answer
bricklayer apprentice
I just manually force a new deployment for my development environment whenever I push updates to ECR. Itโ€™s simple for smaller projects.
Reply to this answer
WhyNotWednesday
They actually have this feature built into AWS App Runner, which is a more managed service. That could be a sign of where they draw the line between managed functions and manual processes.
Reply to this answer
~on the mend
The reality is that ECS needs to be told to reload the container, as it doesn't do this automatically. Using EventBridge could be your best bet for a hands-off approach, since it doesnโ€™t depend on a CI/CD system. If AWS ever adds an auto-reload feature for ECS, that's likely how it would work behind the scenes.
Reply to this answer
LOW.traffic
I usually manage it through CI/CD myself. If you're consistently using the latest tag, a new deployment can be forced easily on your service. Alternatively, you could set up a Lambda function or CloudFormation stack that triggers on new image uploads to automatically update your task definition with the new image tag.

PAUSE_button: Using Lambda to automatically trigger a new deployment when there are new changes in ECR sounds like a solid approach! I havenโ€™t tried it yet myself.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions