When are AWS ECR lifecycle policies applied?

Viewed 653

I don't see any changes to the images after I add lifecycle policies like this one:

{
  "rulePriority": 1,
  "description": "Keep last 5 images",
  "selection": {
    "tagStatus": "any",
    "countType": "imageCountMoreThan",
    "countNumber": 5
  },
  "action": {
    "type": "expire"
  }
}

When and how are they applied?

1 Answers

From the first paragraph in the Lifecycle policies user guide:

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

I think AWS keeps this intentionally vague.

I have noticed the same with S3 life cycle policies: I usually have to wait until the following day to see the results and they are not applied instantly.

Related