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.
When the repository has more than 100 images to be deleted an exception is thrown by the ECR BatchDeleteImage api.
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.