Class CfnLegalHold
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.backup.CfnLegalHold
- All Implemented Interfaces:
IInspectable,ILegalHoldRef,IEnvironmentAware,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.138.0 (build 0ca7ee8)",
date="2026-08-10T14:50:57.494Z")
@Stability(Stable)
public class CfnLegalHold
extends CfnResource
implements IInspectable, ILegalHoldRef, ITaggableV2
Creates a legal hold on recovery points (backups).
A legal hold prevents backups from being deleted while under hold.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.backup.*;
CfnLegalHold cfnLegalHold = CfnLegalHold.Builder.create(this, "MyCfnLegalHold")
.description("description")
.recoveryPointSelection(RecoveryPointSelectionProperty.builder()
.dateRange(DateRangeProperty.builder()
.fromDate("fromDate")
.toDate("toDate")
.build())
.resourceIdentifiers(List.of("resourceIdentifiers"))
.vaultNames(List.of("vaultNames"))
.build())
.title("title")
// the properties below are optional
.tags(List.of(TagsItemsProperty.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnLegalHold.static interfaceA date range for filtering recovery points.static interfaceThe criteria to assign a set of resources, such as resource types or backup vaults.static interfaceExample:Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.backup.ILegalHoldRef
ILegalHoldRef.Jsii$Default, ILegalHoldRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnLegalHold(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLegalHold(software.amazon.jsii.JsiiObjectRef objRef) CfnLegalHold(software.constructs.Construct scope, String id, CfnLegalHoldProps props) Create a newAWS::Backup::LegalHold. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForLegalHold(ILegalHoldRef resource) The Amazon Resource Name (ARN) of the legal hold.The time when the legal hold was created.The ID of the legal hold.The status of the legal hold.Tag Manager which manages the tags for this resource.The description of the legal hold.A reference to a LegalHold resource.The criteria to assign a set of resources, such as resource types or backup vaults.getTags()Optional tags to include.getTitle()The title of the legal hold.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnLegalHold.renderProperties(Map<String, Object> props) voidsetDescription(String value) The description of the legal hold.voidThe criteria to assign a set of resources, such as resource types or backup vaults.voidThe criteria to assign a set of resources, such as resource types or backup vaults.voidOptional tags to include.voidThe title of the legal hold.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, addResourceDependency, addResourceDependency, applyCrossStackReferenceStrength, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, cfnPropertyName, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, removeDependency, removeResourceDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId, withMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnLegalHold
protected CfnLegalHold(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLegalHold
protected CfnLegalHold(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLegalHold
@Stability(Stable) public CfnLegalHold(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLegalHoldProps props) Create a newAWS::Backup::LegalHold.- 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.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForLegalHold
- Parameters:
resource- This parameter is required.
-
isCfnLegalHold
Checks whether the given object is a CfnLegalHold.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the legal hold. -
getAttrCreationDate
The time when the legal hold was created. -
getAttrLegalHoldId
The ID of the legal hold. -
getAttrStatus
The status of the legal hold. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getCfnPropertyNames
- Overrides:
getCfnPropertyNamesin classCfnResource
-
getLegalHoldRef
A reference to a LegalHold resource.- Specified by:
getLegalHoldRefin interfaceILegalHoldRef
-
getDescription
The description of the legal hold. -
setDescription
The description of the legal hold. -
getRecoveryPointSelection
The criteria to assign a set of resources, such as resource types or backup vaults.Returns union: either
IResolvableorCfnLegalHold.RecoveryPointSelectionProperty -
setRecoveryPointSelection
The criteria to assign a set of resources, such as resource types or backup vaults. -
setRecoveryPointSelection
@Stability(Stable) public void setRecoveryPointSelection(@NotNull CfnLegalHold.RecoveryPointSelectionProperty value) The criteria to assign a set of resources, such as resource types or backup vaults. -
getTitle
The title of the legal hold. -
setTitle
The title of the legal hold. -
getTags
Optional tags to include. -
setTags
Optional tags to include.
-