Package software.amazon.awscdk
Class RemovalPolicies
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.RemovalPolicies
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:40:43.904Z")
@Stability(Stable)
public class RemovalPolicies
extends software.amazon.jsii.JsiiObject
Manages removal policies for all resources within a construct scope, overriding any existing policies by default.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.*; RemovalPolicies removalPolicies = RemovalPolicies.of(this);
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRemovalPolicies(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedRemovalPolicies(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(RemovalPolicy policy) Apply a removal policy to all resources within this scope, overriding any existing policies.voidapply(RemovalPolicy policy, RemovalPolicyProps props) Apply a removal policy to all resources within this scope, overriding any existing policies.voiddestroy()Apply DESTROY removal policy to all resources within this scope.voiddestroy(RemovalPolicyProps props) Apply DESTROY removal policy to all resources within this scope.static RemovalPoliciesof(software.constructs.IConstruct scope) Returns the removal policies API for the given scope.voidretain()Apply RETAIN removal policy to all resources within this scope.voidretain(RemovalPolicyProps props) Apply RETAIN removal policy to all resources within this scope.voidApply RETAIN_ON_UPDATE_OR_DELETE removal policy to all resources within this scope.voidApply RETAIN_ON_UPDATE_OR_DELETE removal policy to all resources within this scope.voidsnapshot()Apply SNAPSHOT removal policy to all resources within this scope.voidsnapshot(RemovalPolicyProps props) Apply SNAPSHOT removal policy to all resources within this scope.Methods 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, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
RemovalPolicies
protected RemovalPolicies(software.amazon.jsii.JsiiObjectRef objRef) -
RemovalPolicies
protected RemovalPolicies(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
of
@Stability(Stable) @NotNull public static RemovalPolicies of(@NotNull software.constructs.IConstruct scope) Returns the removal policies API for the given scope.- Parameters:
scope- The scope. This parameter is required.
-
apply
@Stability(Stable) public void apply(@NotNull RemovalPolicy policy, @Nullable RemovalPolicyProps props) Apply a removal policy to all resources within this scope, overriding any existing policies.- Parameters:
policy- The removal policy to apply. This parameter is required.props- Configuration options.
-
apply
Apply a removal policy to all resources within this scope, overriding any existing policies.- Parameters:
policy- The removal policy to apply. This parameter is required.
-
destroy
Apply DESTROY removal policy to all resources within this scope.- Parameters:
props- Configuration options.
-
destroy
@Stability(Stable) public void destroy()Apply DESTROY removal policy to all resources within this scope. -
retain
Apply RETAIN removal policy to all resources within this scope.- Parameters:
props- Configuration options.
-
retain
@Stability(Stable) public void retain()Apply RETAIN removal policy to all resources within this scope. -
retainOnUpdateOrDelete
Apply RETAIN_ON_UPDATE_OR_DELETE removal policy to all resources within this scope.- Parameters:
props- Configuration options.
-
retainOnUpdateOrDelete
@Stability(Stable) public void retainOnUpdateOrDelete()Apply RETAIN_ON_UPDATE_OR_DELETE removal policy to all resources within this scope. -
snapshot
Apply SNAPSHOT removal policy to all resources within this scope.- Parameters:
props- Configuration options.
-
snapshot
@Stability(Stable) public void snapshot()Apply SNAPSHOT removal policy to all resources within this scope.
-