Interface LifecyclePolicyAction

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
LifecyclePolicyAction.Jsii$Proxy

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-05T22:26:50.072Z") @Stability(Experimental) public interface LifecyclePolicyAction extends software.amazon.jsii.JsiiSerializable
(experimental) The action to perform in the lifecycle policy rule.

Example:

 LifecyclePolicy disabledPolicy = LifecyclePolicy.Builder.create(this, "DisabledPolicy")
         .lifecyclePolicyName("my-disabled-policy")
         .description("A lifecycle policy that is temporarily disabled")
         .status(LifecyclePolicyStatus.DISABLED)
         .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())
                 .build()))
         .resourceSelection(LifecyclePolicyResourceSelection.builder()
                 .tags(Map.of("Environment", "testing"))
                 .build())
         .tags(Map.of(
                 "Owner", "DevOps",
                 "CostCenter", "Engineering"))
         .build();
 
  • Method Details

    • getType

      @Stability(Experimental) @NotNull LifecyclePolicyActionType getType()
      (experimental) The action to perform on the resources selected in the lifecycle policy rule.
    • getIncludeAmis

      @Stability(Experimental) @Nullable default Boolean getIncludeAmis()
      (experimental) Whether to include AMIs in the scope of the lifecycle rule.

      Default: - true for AMI-based policies, false otherwise

    • getIncludeContainers

      @Stability(Experimental) @Nullable default Boolean getIncludeContainers()
      (experimental) Whether to include containers in the scope of the lifecycle rule.

      Default: - true for container-based policies, false otherwise

    • getIncludeSnapshots

      @Stability(Experimental) @Nullable default Boolean getIncludeSnapshots()
      (experimental) Whether to include snapshots in the scope of the lifecycle rule.

      Default: - true for AMI-based policies, false otherwise

    • builder

      @Stability(Experimental) static LifecyclePolicyAction.Builder builder()
      Returns:
      a LifecyclePolicyAction.Builder of LifecyclePolicyAction