- Newest
- Most votes
- Most comments
Hello.
Another option (which is what I'm using) is to update Job Definitions every time the ECR image gets rebuilt. This works but it feels like a game of cat-and-mouse where I have to make sure that I find and update everywhere that image is used.
I often update using this method.
It is also possible to automate this by introducing CI/CD and updating the task definition when the container image is pushed to ECR.
CodePipeline can launch CI/CD using ECR as a source.
https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-ECR.html
You can use a use a mutable tag like :latest in your Job Definitions for the container image:
<aws_account_id>.dkr.ecr.<region>.amazonaws.com/<repository_name>:latest
Pros:
- No need to update Job Definitions after each image build.
- Simplifies CI/CD pipelines, especially for dev/test environments.
Cons:
- Loss of immutability — you can't guarantee which image was used for a specific job run.
- Harder to trace/debug if something breaks due to a silent image update.
Using :latest is fine for non-critical environments, but for production workloads, consider immutable tags with automation to keep things traceable and maintainable.
I came here looking for a strategy because I don’t want to use latest either. I’m planning to have my pipeline create a new Job Definition for each image version but was looking for best practices and a pattern. I think part of the difference is that I use a separate ECR repo for each environment (dev/test/prod), so I don’t rely on re-tagging images. Just thought I’d share in case it helps someone else exploring options.
answered a year ago
Relevant content
asked 3 years ago
asked 5 years ago
- AWS OFFICIALUpdated 5 months ago

We are using GitHub Actions for our CI/CD and I'm using "aws batch describe-job-definitions" and "aws batch register-job-definition" CLI commands to do most of the heavy lifting. It works but it's a bit clumsy and requires us to keep track of every single use of that container image in AWS and update it every time a new image it pushed to ECR. There seems like there should be a better way.