We have a lot of ECR repos that needed to be taken down, so I ran this little aws-cli + ruby + jq script to sanity check if all the images are old
require 'json' repos = `aws ecr describe-repositories | jq .repositories[].repositoryName --raw-output`.split("\n") pushed = repos.map do |repo| out = `aws ecr describe-images --repository-name #{repo} --output json --query 'sort_by(imageDetails,& imagePushedAt)[*]'` print '.' next unless image = JSON.parse(out).first Integer(image["imagePushedAt"]) end.compact puts Time.at(pushed.max)