interface LifecyclePolicyAgeFilter
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ImageBuilder.Alpha.LifecyclePolicyAgeFilter |
Go | github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2#LifecyclePolicyAgeFilter |
Java | software.amazon.awscdk.services.imagebuilder.alpha.LifecyclePolicyAgeFilter |
Python | aws_cdk.aws_imagebuilder_alpha.LifecyclePolicyAgeFilter |
TypeScript (source) | @aws-cdk/aws-imagebuilder-alpha ยป LifecyclePolicyAgeFilter |
The age-based filtering to apply in a lifecycle policy rule.
Example
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
| Name | Type | Description |
|---|---|---|
| age | Duration | The minimum age of the resource to filter. |
| retain | number | For age-based filters, the number of EC2 Image Builder images to keep on hand once the rule is applied. |
age
Type:
Duration
The minimum age of the resource to filter.
The provided duration will be rounded up to the nearest day/week/month/year value.
retainAtLeast?
Type:
number
(optional, default: 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.

.NET
Go
Java
Python
TypeScript (