interface LifecyclePolicyAmiExclusionRules
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ImageBuilder.Alpha.LifecyclePolicyAmiExclusionRules |
Go | github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2#LifecyclePolicyAmiExclusionRules |
Java | software.amazon.awscdk.services.imagebuilder.alpha.LifecyclePolicyAmiExclusionRules |
Python | aws_cdk.aws_imagebuilder_alpha.LifecyclePolicyAmiExclusionRules |
TypeScript (source) | @aws-cdk/aws-imagebuilder-alpha ยป LifecyclePolicyAmiExclusionRules |
The rules to apply for excluding AMIs 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 |
|---|---|---|
| is | boolean | Excludes public AMIs from the lifecycle policy rule if true. |
| last | Duration | Excludes AMIs which were launched from within the provided duration. |
| regions? | string[] | Excludes AMIs which reside in any of the provided regions. |
| shared | string[] | Excludes AMIs which are shared with any of the provided shared accounts. |
| tags? | { [string]: string } | Excludes AMIs which have any of the provided tags applied to it. |
isPublic?
Type:
boolean
(optional, default: false)
Excludes public AMIs from the lifecycle policy rule if true.
lastLaunched?
Type:
Duration
(optional, default: None)
Excludes AMIs which were launched from within the provided duration.
regions?
Type:
string[]
(optional, default: None)
Excludes AMIs which reside in any of the provided regions.
sharedAccounts?
Type:
string[]
(optional, default: None)
Excludes AMIs which are shared with any of the provided shared accounts.
tags?
Type:
{ [string]: string }
(optional, default: None)
Excludes AMIs which have any of the provided tags applied to it.

.NET
Go
Java
Python
TypeScript (