Menu
Amazon ECR
User Guide (API Version 2015-09-21)

Creating a Lifecycle Policy Preview

A lifecycle policy preview allows you to see the impact of a lifecycle policy on an image repository before you execute it. The following procedure shows you how to create a lifecycle policy preview using the console.

Setting up a lifecycle policy preview using the console

  1. Open the Amazon ECS console at https://console.aws.amazon.com/ecs/.

  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 All repositories: repository_name page, choose Dry-Run Lifecycle Rules, Add.

  5. 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 either Tagged or Untagged.

    4. If you specified Tagged for Image Status, then for Tag Prefix List, 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 Count Type, Count Number, and Count Unit (if applicable).

  6. Choose Save

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

  8. To run the lifecycle policy preview, choose Save and preview results.

  9. Under Preview Image Results, review the impact of your lifecycle policy preview.

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

Note

You should expect that after creating a lifecycle policy the affected images will be expired within 24 hours.