According to https://docs.aws.amazon.com/AmazonECR/latest/userguide/retag-aws-cli.html, it describe how to retagging exist image's tag.
So I tried to execute command.
MANIFEST=$(aws ecr batch-get-image --repository-name test --image-ids imageTag=latest --query 'images[].imageManifest' --output text)aws ecr put-image --repository-name test --image-tag old-version --image-manifest "$MANIFEST"
(This command find image that has latest and changed it to old-version)
Expected re-named tag is old-version.
But when I checked in ECR, it has both latest and old-version.
How can I delete latest tag and give it to old-version tag only?