Creating a lifecycle policy preview - Amazon ECR

Creating a lifecycle policy preview

A lifecycle policy preview provides a way see the impact of a lifecycle policy on an image repository before you apply it. It is considered best practice to do a preview before applying a lifecycle policy to a repository. The following procedure shows you how to create a lifecycle policy preview.

To create a lifecycle policy preview (AWS Management Console)

  1. Open the Amazon ECR console at

  2. From the navigation bar, choose the Region that contains the repository on which to perform a lifecycle policy preview.

  3. In the navigation pane, choose Repositories and select a repository.

  4. On the Repositories: repository_name page, in the navigation pane choose Lifecycle Policy.


    If you don't see the Lifecycle Policy option in the navigation pane, ensure that you are in the repository image list view.

  5. On the Repositories: repository_name: Lifecycle policy page, choose Edit test rules, Create rule.

  6. Enter the following details for your lifecycle policy rule:

    1. For Rule priority, type a number for the rule priority.

    2. For Rule description, type a description for the lifecycle policy rule.

    3. For Image status, choose Tagged, Untagged, or Any.

    4. If you specified Tagged for Image status, then for Tag prefixes, you can optionally specify a list of image tags on which to take action with your lifecycle policy. If you specified Untagged, this field must be empty.

    5. For Match criteria, choose values for Since image pushed or Image count more than (if applicable).

  7. Choose Save.

  8. Create additional lifecycle policy rules by repeating steps 5–7.

  9. To run the lifecycle policy preview, choose Save and run test.

  10. Under Image matches for test lifecycle rules, review the impact of your lifecycle policy preview.

  11. If you are satisfied with the preview results, choose Apply as lifecycle policy to create a lifecycle policy with the specified rules.


You should expect that after applying a lifecycle policy, the affected images are expired within 24 hours.