Skip to content
v2.275.0

Experimental

@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

LifecyclePolicyAgeFilter Struct ​

The age-based filtering to apply in a lifecycle policy rule.

Example ​

ts
const disabledPolicy = new imagebuilder.LifecyclePolicy(this, 'DisabledPolicy', {
  lifecyclePolicyName: 'my-disabled-policy',
  description: 'A lifecycle policy that is temporarily disabled',
  status: imagebuilder.LifecyclePolicyStatus.DISABLED,
  resourceType: imagebuilder.LifecyclePolicyResourceType.AMI_IMAGE,
  details: [
    {
      action: { type: imagebuilder.LifecyclePolicyActionType.DELETE },
      filter: { ageFilter: { age: Duration.days(30) } }
    }
  ],
  resourceSelection: {
    tags: { Environment: 'testing' }
  },
  tags: {
    Owner: 'DevOps',
    CostCenter: 'Engineering'
  }
});

Properties ​

The minimum age of the resource to filter.

The provided duration will be rounded up to the nearest day/week/month/year value.

retainAtLeastoptionalnumberretain_at_leastoptionalint | floatretainAtLeastoptionalNumberRetainAtLeastoptionaldoubleRetainAtLeastoptional*float64= 0#
For age-based filters, the number of EC2 Image Builder images to keep on hand once the rule is applied.

The value must be between 1 and 10.