A team stores release images in an Amazon ECR repository using version tags such as 2.4.1. Last week a developer rebuilt an older branch and pushed it with an existing version tag, so a later deployment pulled different code than the tag had before. The team wants ECR to reject any push that reuses a tag. What should a developer configure?
Choose one.
ECR tag immutability makes every tag in a repository point at one image for good.
In a mutable repository a push with an existing tag silently moves the tag to the new image. Turning on tag immutability makes ECR reject such a push with ImageTagAlreadyExistsException, so a version tag always identifies the same image. Lifecycle rules and scanning manage or inspect images after they arrive, and denying PutImage stops all pushes.
- Identify the problem: a tag was overwritten by a later push.
- Look for a repository setting that rejects reused tags.
- Recall that tag immutability returns ImageTagAlreadyExistsException.
- Turn it on for the release repository.
Exam tip: Want a tag to mean one image forever? Turn on ECR tag immutability.
DVA-C03 Deployment Artifacts: Dependencies, ECR Images, AppConfig and API Gateway Stages — the lesson that teaches this.