Batch deleting ECR Images
Feb 12, 2021
Sometimes you go to delete a CloudFormation stack or destroy some Terraform and the run fails to delete an ECR repo because the repository still contains images.
Here is a quick and dirty way to empty that repo before you retry your delete. Excuse the ugly python. Its a one-off script not a maintained project. 😉
Invoke it like this: ./ecr_purge.py my-ecr-repo-name
Then go back and press delete on your CloudFormation stack and voilà!