interface LifecyclePolicyExclusionRules
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ImageBuilder.Alpha.LifecyclePolicyExclusionRules |
Go | github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2#LifecyclePolicyExclusionRules |
Java | software.amazon.awscdk.services.imagebuilder.alpha.LifecyclePolicyExclusionRules |
Python | aws_cdk.aws_imagebuilder_alpha.LifecyclePolicyExclusionRules |
TypeScript (source) | @aws-cdk/aws-imagebuilder-alpha ยป LifecyclePolicyExclusionRules |
The rules to apply for excluding resources from the lifecycle policy rule.
Example
const excludeAmisPolicy = new imagebuilder.LifecyclePolicy(this, 'ExcludeAmisPolicy', {
resourceType: imagebuilder.LifecyclePolicyResourceType.AMI_IMAGE,
details: [
{
action: { type: imagebuilder.LifecyclePolicyActionType.DELETE },
filter: { ageFilter: { age: Duration.days(30) } },
exclusionRules: {
amiExclusionRules: {
isPublic: true, // Exclude public AMIs
lastLaunched: Duration.days(7), // Exclude AMIs launched in last 7 days
regions: ['us-west-2', 'eu-west-1'], // Exclude AMIs in specific regions
sharedAccounts: ['123456789012'], // Exclude AMIs shared with specific accounts
tags: {
Protected: 'true',
Environment: 'production'
}
}
}
}
],
resourceSelection: {
tags: { Team: 'infrastructure' }
}
});
Properties
| Name | Type | Description |
|---|---|---|
| ami | Lifecycle | The rules to apply for excluding AMIs from the lifecycle policy rule. |
| image | Lifecycle | The rules to apply for excluding EC2 Image Builder images from the lifecycle policy rule. |
amiExclusionRules?
Type:
Lifecycle
(optional, default: no exclusion rules are applied on the AMI)
The rules to apply for excluding AMIs from the lifecycle policy rule.
imageExclusionRules?
Type:
Lifecycle
(optional, default: no exclusion rules are applied on the image)
The rules to apply for excluding EC2 Image Builder images from the lifecycle policy rule.

.NET
Go
Java
Python
TypeScript (