Class CfnLifecyclePolicy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLifecyclePolicy>
- Enclosing class:
CfnLifecyclePolicy
CfnLifecyclePolicy
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
[Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.copyTags
(IResolvable copyTags) [Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.static CfnLifecyclePolicy.Builder
createInterval
(Number createInterval) [Default policies only] Specifies how often the policy should run and create snapshots or AMIs.crossRegionCopyTargets
(Object crossRegionCopyTargets) [Default policies only] Specifies destination Regions for snapshot or AMI copies.defaultPolicy
(String defaultPolicy) [Default policies only] Specify the type of default policy to create.description
(String description) A description of the lifecycle policy.exclusions
(IResolvable exclusions) [Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs.exclusions
(CfnLifecyclePolicy.ExclusionsProperty exclusions) [Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs.executionRoleArn
(String executionRoleArn) The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.extendDeletion
(Boolean extendDeletion) [Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.extendDeletion
(IResolvable extendDeletion) [Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.policyDetails
(IResolvable policyDetails) The configuration details of the lifecycle policy.policyDetails
(CfnLifecyclePolicy.PolicyDetailsProperty policyDetails) The configuration details of the lifecycle policy.retainInterval
(Number retainInterval) [Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them.The activation state of the lifecycle policy.The tags to apply to the lifecycle policy during creation.
-
Method Details
-
create
@Stability(Stable) public static CfnLifecyclePolicy.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.- Returns:
- a new instance of
CfnLifecyclePolicy.Builder
.
-
copyTags
[Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.If you do not specify a value, the default is
false
.Default: false
- Parameters:
copyTags
- [Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI. This parameter is required.- Returns:
this
- See Also:
-
copyTags
[Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.If you do not specify a value, the default is
false
.Default: false
- Parameters:
copyTags
- [Default policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI. This parameter is required.- Returns:
this
- See Also:
-
createInterval
[Default policies only] Specifies how often the policy should run and create snapshots or AMIs.The creation frequency can range from 1 to 7 days. If you do not specify a value, the default is 1.
Default: 1
- Parameters:
createInterval
- [Default policies only] Specifies how often the policy should run and create snapshots or AMIs. This parameter is required.- Returns:
this
- See Also:
-
crossRegionCopyTargets
@Stability(Stable) public CfnLifecyclePolicy.Builder crossRegionCopyTargets(Object crossRegionCopyTargets) [Default policies only] Specifies destination Regions for snapshot or AMI copies.You can specify up to 3 destination Regions. If you do not want to create cross-Region copies, omit this parameter.
- Parameters:
crossRegionCopyTargets
- [Default policies only] Specifies destination Regions for snapshot or AMI copies. This parameter is required.- Returns:
this
- See Also:
-
defaultPolicy
[Default policies only] Specify the type of default policy to create.- To create a default policy for EBS snapshots, that creates snapshots of all volumes in the Region that do not have recent backups, specify
VOLUME
. - To create a default policy for EBS-backed AMIs, that creates EBS-backed AMIs from all instances in the Region that do not have recent backups, specify
INSTANCE
.
- Parameters:
defaultPolicy
- [Default policies only] Specify the type of default policy to create. This parameter is required.- Returns:
this
- See Also:
- To create a default policy for EBS snapshots, that creates snapshots of all volumes in the Region that do not have recent backups, specify
-
description
A description of the lifecycle policy.The characters ^[0-9A-Za-z _-]+$ are supported.
- Parameters:
description
- A description of the lifecycle policy. This parameter is required.- Returns:
this
- See Also:
-
exclusions
[Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs.The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.
- Parameters:
exclusions
- [Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs. This parameter is required.- Returns:
this
- See Also:
-
exclusions
@Stability(Stable) public CfnLifecyclePolicy.Builder exclusions(CfnLifecyclePolicy.ExclusionsProperty exclusions) [Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs.The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.
- Parameters:
exclusions
- [Default policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs. This parameter is required.- Returns:
this
- See Also:
-
executionRoleArn
The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.- Parameters:
executionRoleArn
- The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy. This parameter is required.- Returns:
this
- See Also:
-
extendDeletion
[Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.By default ( ExtendDeletion=false ):
- If a source resource is deleted, Amazon Data Lifecycle Manager will continue to delete previously created snapshots or AMIs, up to but not including the last one, based on the specified retention period. If you want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, including the last one, specify
true
. - If a policy enters the error, disabled, or deleted state, Amazon Data Lifecycle Manager stops deleting snapshots and AMIs. If you want Amazon Data Lifecycle Manager to continue deleting snapshots or AMIs, including the last one, if the policy enters one of these states, specify
true
.
If you enable extended deletion ( ExtendDeletion=true ), you override both default behaviors simultaneously.
If you do not specify a value, the default is
false
.Default: false
- Parameters:
extendDeletion
- [Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state. This parameter is required.- Returns:
this
- See Also:
- If a source resource is deleted, Amazon Data Lifecycle Manager will continue to delete previously created snapshots or AMIs, up to but not including the last one, based on the specified retention period. If you want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, including the last one, specify
-
extendDeletion
[Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.By default ( ExtendDeletion=false ):
- If a source resource is deleted, Amazon Data Lifecycle Manager will continue to delete previously created snapshots or AMIs, up to but not including the last one, based on the specified retention period. If you want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, including the last one, specify
true
. - If a policy enters the error, disabled, or deleted state, Amazon Data Lifecycle Manager stops deleting snapshots and AMIs. If you want Amazon Data Lifecycle Manager to continue deleting snapshots or AMIs, including the last one, if the policy enters one of these states, specify
true
.
If you enable extended deletion ( ExtendDeletion=true ), you override both default behaviors simultaneously.
If you do not specify a value, the default is
false
.Default: false
- Parameters:
extendDeletion
- [Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state. This parameter is required.- Returns:
this
- See Also:
- If a source resource is deleted, Amazon Data Lifecycle Manager will continue to delete previously created snapshots or AMIs, up to but not including the last one, based on the specified retention period. If you want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, including the last one, specify
-
policyDetails
The configuration details of the lifecycle policy.If you create a default policy, you can specify the request parameters either in the request body, or in the PolicyDetails request structure, but not both.
- Parameters:
policyDetails
- The configuration details of the lifecycle policy. This parameter is required.- Returns:
this
- See Also:
-
policyDetails
@Stability(Stable) public CfnLifecyclePolicy.Builder policyDetails(CfnLifecyclePolicy.PolicyDetailsProperty policyDetails) The configuration details of the lifecycle policy.If you create a default policy, you can specify the request parameters either in the request body, or in the PolicyDetails request structure, but not both.
- Parameters:
policyDetails
- The configuration details of the lifecycle policy. This parameter is required.- Returns:
this
- See Also:
-
retainInterval
[Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them.The retention period can range from 2 to 14 days, but it must be greater than the creation frequency to ensure that the policy retains at least 1 snapshot or AMI at any given time. If you do not specify a value, the default is 7.
Default: 7
- Parameters:
retainInterval
- [Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them. This parameter is required.- Returns:
this
- See Also:
-
state
The activation state of the lifecycle policy.- Parameters:
state
- The activation state of the lifecycle policy. This parameter is required.- Returns:
this
- See Also:
-
tags
The tags to apply to the lifecycle policy during creation.- Parameters:
tags
- The tags to apply to the lifecycle policy during creation. This parameter is required.- Returns:
this
- See Also:
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnLifecyclePolicy>
- Returns:
- a newly built instance of
CfnLifecyclePolicy
.
-