Interface LifecyclePolicyResourceSelection

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

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-05T22:26:50.095Z") @Stability(Experimental) public interface LifecyclePolicyResourceSelection extends software.amazon.jsii.JsiiSerializable
(experimental) Selection criteria for the resources that the lifecycle policy applies to.

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

    • getRecipes

      @Stability(Experimental) @Nullable default List<IRecipeBase> getRecipes()
      (experimental) The list of image recipes or container recipes to apply the lifecycle policy to.

      Default: - none if tag selections are provided. Otherwise, at least one recipe or tag selection must be provided

    • getTags

      @Stability(Experimental) @Nullable default Map<String,String> getTags()
      (experimental) Selects EC2 Image Builder images containing any of the provided tags.

      Default: - none if recipe selections are provided. Otherwise, at least one recipe or tag selection must be provided

    • builder

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