Mods

Policy: AWS > ECR > Repository > Lifecycle Policy > Required > Items

A list of lifecycle policy rules that must be present on the repository.

Targets

This policy targets the following resource types:

Primary Policy

This policy is used with the following primary policy:

Controls

Setting this policy configures this control:

Policy Specification

Schema Type
array
Default
[]
Examples [YAML]
  • - rulePriority: 1
      description: Expire images older than 365 days
      selection:
        tagStatus: any
        countType: sinceImagePushed
        countUnit: days
        countNumber: 365
      action:
        type: expire
    
  • - rulePriority: 1
      description: Keep only the 10 most recent images
      selection:
        tagStatus: any
        countType: imageCountMoreThan
        countNumber: 10
      action:
        type: expire
    
  • - rulePriority: 1
      description: Expire untagged images older than 14 days
      selection:
        tagStatus: untagged
        countType: sinceImagePushed
        countUnit: days
        countNumber: 14
      action:
        type: expire
    - rulePriority: 2
      description: Keep only the 5 most recent release images
      selection:
        tagStatus: tagged
        tagPrefixList:
          - release
          - v
        countType: imageCountMoreThan
        countNumber: 5
      action:
        type: expire
    

Category

In Your Workspace

Developers