Class CfnLifecyclePolicy.RetainRuleProperty.Builder
java.lang.Object
software.amazon.awscdk.services.dlm.CfnLifecyclePolicy.RetainRuleProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLifecyclePolicy.RetainRuleProperty>
- Enclosing interface:
CfnLifecyclePolicy.RetainRuleProperty
@Stability(Stable)
public static final class CfnLifecyclePolicy.RetainRuleProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnLifecyclePolicy.RetainRuleProperty>
A builder for
CfnLifecyclePolicy.RetainRuleProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofCfnLifecyclePolicy.RetainRuleProperty.getCount()
Sets the value ofCfnLifecyclePolicy.RetainRuleProperty.getInterval()
intervalUnit
(String intervalUnit) Sets the value ofCfnLifecyclePolicy.RetainRuleProperty.getIntervalUnit()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
count
Sets the value ofCfnLifecyclePolicy.RetainRuleProperty.getCount()
- Parameters:
count
- The number of snapshots to retain for each volume, up to a maximum of 1000. For example if you want to retain a maximum of three snapshots, specify3
. When the fourth snapshot is created, the oldest retained snapshot is deleted, or it is moved to the archive tier if you have specified an ArchiveRule .- Returns:
this
-
interval
Sets the value ofCfnLifecyclePolicy.RetainRuleProperty.getInterval()
- Parameters:
interval
- The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.- Returns:
this
-
intervalUnit
@Stability(Stable) public CfnLifecyclePolicy.RetainRuleProperty.Builder intervalUnit(String intervalUnit) Sets the value ofCfnLifecyclePolicy.RetainRuleProperty.getIntervalUnit()
- Parameters:
intervalUnit
- The unit of time for time-based retention. For example, to retain snapshots for 3 months, specifyInterval=3
andIntervalUnit=MONTHS
. Once the snapshot has been retained for 3 months, it is deleted, or it is moved to the archive tier if you have specified an ArchiveRule .- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnLifecyclePolicy.RetainRuleProperty>
- Returns:
- a new instance of
CfnLifecyclePolicy.RetainRuleProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-