Class CfnLifecyclePolicy.FilterProperty.Builder
java.lang.Object
software.amazon.awscdk.services.imagebuilder.CfnLifecyclePolicy.FilterProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLifecyclePolicy.FilterProperty>
- Enclosing interface:
CfnLifecyclePolicy.FilterProperty
@Stability(Stable)
public static final class CfnLifecyclePolicy.FilterProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnLifecyclePolicy.FilterProperty>
A builder for
CfnLifecyclePolicy.FilterProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.retainAtLeast
(Number retainAtLeast) Sets the value ofCfnLifecyclePolicy.FilterProperty.getRetainAtLeast()
Sets the value ofCfnLifecyclePolicy.FilterProperty.getType()
Sets the value ofCfnLifecyclePolicy.FilterProperty.getUnit()
Sets the value ofCfnLifecyclePolicy.FilterProperty.getValue()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
type
Sets the value ofCfnLifecyclePolicy.FilterProperty.getType()
- Parameters:
type
- Filter resources based on eitherage
orcount
. This parameter is required.- Returns:
this
-
value
Sets the value ofCfnLifecyclePolicy.FilterProperty.getValue()
- Parameters:
value
- The number of units for the time period or for the count. This parameter is required. For example, a value of6
might refer to six months or six AMIs.For count-based filters, this value represents the minimum number of resources to keep on hand. If you have fewer resources than this number, the resource is excluded from lifecycle actions.
- Returns:
this
-
retainAtLeast
@Stability(Stable) public CfnLifecyclePolicy.FilterProperty.Builder retainAtLeast(Number retainAtLeast) Sets the value ofCfnLifecyclePolicy.FilterProperty.getRetainAtLeast()
- Parameters:
retainAtLeast
- For age-based filters, this is the number of resources to keep on hand after the lifecycleDELETE
action is applied. Impacted resources are only deleted if you have more than this number of resources. If you have fewer resources than this number, the impacted resource is not deleted.- Returns:
this
-
unit
Sets the value ofCfnLifecyclePolicy.FilterProperty.getUnit()
- Parameters:
unit
- Defines the unit of time that the lifecycle policy uses to determine impacted resources. This is required for age-based rules.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnLifecyclePolicy.FilterProperty>
- Returns:
- a new instance of
CfnLifecyclePolicy.FilterProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-