Interface LifecyclePolicyAmiExclusionRules
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
LifecyclePolicyAmiExclusionRules.Jsii$Proxy
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:50.073Z")
@Stability(Experimental)
public interface LifecyclePolicyAmiExclusionRules
extends software.amazon.jsii.JsiiSerializable
(experimental) The rules to apply for excluding AMIs from the lifecycle policy rule.
Example:
LifecyclePolicy excludeAmisPolicy = LifecyclePolicy.Builder.create(this, "ExcludeAmisPolicy")
.resourceType(LifecyclePolicyResourceType.AMI_IMAGE)
.details(List.of(LifecyclePolicyDetail.builder()
.action(LifecyclePolicyAction.builder().type(LifecyclePolicyActionType.DELETE).build())
.filter(LifecyclePolicyFilter.builder().ageFilter(LifecyclePolicyAgeFilter.builder().age(Duration.days(30)).build()).build())
.exclusionRules(LifecyclePolicyExclusionRules.builder()
.amiExclusionRules(LifecyclePolicyAmiExclusionRules.builder()
.isPublic(true) // Exclude public AMIs
.lastLaunched(Duration.days(7)) // Exclude AMIs launched in last 7 days
.regions(List.of("us-west-2", "eu-west-1")) // Exclude AMIs in specific regions
.sharedAccounts(List.of("123456789012")) // Exclude AMIs shared with specific accounts
.tags(Map.of(
"Protected", "true",
"Environment", "production"))
.build())
.build())
.build()))
.resourceSelection(LifecyclePolicyResourceSelection.builder()
.tags(Map.of("Team", "infrastructure"))
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forLifecyclePolicyAmiExclusionRulesstatic final classAn implementation forLifecyclePolicyAmiExclusionRules -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default Boolean(experimental) Excludes public AMIs from the lifecycle policy rule if true.default Duration(experimental) Excludes AMIs which were launched from within the provided duration.(experimental) Excludes AMIs which reside in any of the provided regions.(experimental) Excludes AMIs which are shared with any of the provided shared accounts.getTags()(experimental) Excludes AMIs which have any of the provided tags applied to it.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getIsPublic
(experimental) Excludes public AMIs from the lifecycle policy rule if true.Default: false
-
getLastLaunched
(experimental) Excludes AMIs which were launched from within the provided duration.Default: None
-
getRegions
(experimental) Excludes AMIs which reside in any of the provided regions.Default: None
-
getTags
(experimental) Excludes AMIs which have any of the provided tags applied to it.Default: None
-
builder
-