@Generated(value="jsii-pacmak/1.34.0 (build 9b72778)", date="2021-09-17T00:39:27.134Z") public enum RemovalPolicy extends java.lang.Enum<RemovalPolicy>
The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:
The Removal Policy applies to all above cases.
Many stateful resources in the AWS Construct Library will accept a
removalPolicy as a property, typically defaulting it to
If the AWS Construct Library resource does not accept a
argument, you can always configure it by using the escape hatch mechanism,
as shown in the following example:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 Object cfnBucket = (Object)bucket.node.findChild("Resource"); cfnBucket.applyRemovalPolicy(cdk.RemovalPolicy.getDESTROY());
|Enum Constant and Description|
This is the default removal policy.
This uses the 'Retain' DeletionPolicy, which will cause the resource to be retained in the account, but orphaned from the stack.
This retention policy deletes the resource, but saves a snapshot of its data before deleting, so that it can be re-created later.
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final RemovalPolicy DESTROY
It means that when the resource is removed from the app, it will be physically destroyed.
public static final RemovalPolicy RETAIN
public static final RemovalPolicy SNAPSHOT
Only available for some stateful resources, like databases, EFS volumes, etc.
public static RemovalPolicy values()
for (RemovalPolicy c : RemovalPolicy.values()) System.out.println(c);
public static RemovalPolicy valueOf(java.lang.String name)
name- the name of the enum constant to be returned.
java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
java.lang.NullPointerException- if the argument is null