Skip to content

ECR : Add support for archive storage class #45199

@lbertorello

Description

@lbertorello

Description

Hi,
Amazon ECR now offers a new archive storage class to reduce storage costs for large volumes of rarely accessed container images. The new archive storage class helps you meet your compliance and retention requirements while optimizing storage cost. As part of this launch, ECR lifecycle policies now support archiving images based on last pull time, allowing you to use lifecycle rules to automatically archive images based on usage patterns.

Affected Resource(s) or Data Source(s)

  • data : aws_ecr_lifecycle_policy

Potential Terraform Configuration

data "aws_ecr_lifecycle_policy_document" "ecr_lifecycle_policy" {
  rule {
    priority    = 1
    description = "Archive unused images after 90 days"

    selection {
      tag_status   = "any"
      count_type   = "sinceImagePulled"
      count_unit   = "days"
      count_number = 90
    }

    action {
      type                 = "transition"
      target_storage_class = "archive"
    }
  }

  rule {
    priority    = 2
    description = "Delete archive images after 90 days"

    selection {
      tag_status    = "any"
      count_type    = "sinceImageTransitioned"
      count_unit    = "days"
      storage_class = "archive"
      count_number  = 90
    }

    action {
      type = "expire"
    }
  }
}

References

https://aws.amazon.com/about-aws/whats-new/2025/11/amazon-ecr-archive-storage-class-container-images/

Would you like to implement the enhancement?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequests to existing resources that expand the functionality or scope.service/ecrIssues and PRs that pertain to the ecr service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions