Get all ECR images with more than 900 tags.
AWS has a hard limit of 1000 tags on any single image.
Attempting to push another tag on that image will result in an error like the following:
ERROR: failed commit on ref "index-sha256:......": unexpected status from PUT request to https://ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/v2/REPOSITORY/manifests/TAG_NAME: 403 Forbidden
In CloudTrail the error looks like:
Adding tag 'TAG_NAME' to an image in the repository with name 'REPOSITORY' in registry with id 'ACCOUNT_ID' exceeds the maximum allowed number of tags per image which is '1000'
This script prints out each image that has more than 900 tags, to identify which images are close to this limit.