Restore an expired image

Bring back an image a lifecycle rule deleted, with the tags nothing has taken since, before it is purged.

Last updated 18 November 2026View as Markdown

An image a lifecycle rule deleted stays restorable until its purge time. Replace repository-id with the repository's id and the digest with the image's.

Prerequisites

  • Permission for ecr:RestoreExpiredItem on the repository.
  • To list expired images: ecr:GetLifecyclePolicy on the repository. Without it the console's Lifecycle policy tab says so.
  • In the console, also ecr:DescribeRepositories on the repository; without it its page answers 404.

Restore it

  1. Open Image repositories, open the repository, then the Lifecycle policy tab.
  2. Under Recently deleted by a rule, find the image by Tags it had and Digest. Why says which rule deleted it, Purged when it goes for good, and Pulled since whether something tried to pull it since.
  3. Choose Restore.

A signature or SBOM row has no Restore: it comes back with its image.

Result

200 with restoredTags, the tags given back, and takenTags, those another image holds by now, which stay where they are. A multi-platform image comes back with its platform images, and every image with its signatures. The restore is recorded on the repository.

If the rule still selects the image, the next hourly run deletes it again; give the repository a policy that keeps it first (see Set a lifecycle policy).

If it is refused

  • 404 No restorable expired image with that digest when it was never expired or is purged.
  • 409 with code QuotaExceeded while the organization's or the repository's storage quota is already full.
Did this page help you?