Search code examples
amazon-web-servicesamazon-ecr

ECR lifecycle policies configured tracking


Is there a way to check if the ECR repositories do not have configured life-cycle policies?

ecr-lifecycle-policy

Currently, I have several repositories and would like to keep monitoring at each one of them if any are having life-cycle policies configured or not.


Solution

  • You can track your ECR repositories with AWS Config: https://ap-southeast-1.console.aws.amazon.com/config/home?region=ap-southeast-1#/rules

    There is a rule named - ecr-private-lifecycle-policy-configured.

    https://docs.aws.amazon.com/config/latest/developerguide/ecr-private-lifecycle-policy-configured.html

    If there are any repositories without lifecycle config, the service will show you the list of non-compliant resources.

    ecr-private-lifecycle-policy-configured