awslabs / ecr-cleanup-lambda

A script to discover stale ECR images and take action on them with Lambda to help reduce costs.
Other
161 stars 96 forks source link

Exception when repo has more than 100 images to be deleted. #11

Closed mark-burns closed 7 years ago

mark-burns commented 7 years ago

When the repository has more than 100 images to be deleted an exception is thrown by the ECR BatchDeleteImage api.

An error occurred (InvalidParameterException) when calling the BatchDeleteImage operation: Invalid parameter at 'imageIds' failed to satisfy constraint: 'Member must have length less than or equal to 100': InvalidParameterException

The work around is to run the Lambda with a larger value for IMAGES_TO_KEEP until you have cleaned out enough images to avoid the error.