Show / Hide Table of Contents

Enum CfnDeletionPolicy

With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted.

Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum CfnDeletionPolicy
Syntax (vb)
Public Enum CfnDeletionPolicy
Remarks

You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default. Note that this capability also applies to update operations that lead to resources being removed.

Synopsis

Fields

DELETE

AWS CloudFormation deletes the resource and all its content if applicable during stack deletion.

RETAIN

AWS CloudFormation keeps the resource without deleting the resource or its contents when its stack is deleted.

RETAIN_EXCEPT_ON_CREATE

RetainExceptOnCreate behaves like Retain for stack operations, except for the stack operation that initially created the resource.

SNAPSHOT

For resources that support snapshots (AWS::EC2::Volume, AWS::ElastiCache::CacheCluster, AWS::ElastiCache::ReplicationGroup, AWS::RDS::DBInstance, AWS::RDS::DBCluster, and AWS::Redshift::Cluster), AWS CloudFormation creates a snapshot for the resource before deleting it.

Fields

Name Description
DELETE

AWS CloudFormation deletes the resource and all its content if applicable during stack deletion.

RETAIN

AWS CloudFormation keeps the resource without deleting the resource or its contents when its stack is deleted.

RETAIN_EXCEPT_ON_CREATE

RetainExceptOnCreate behaves like Retain for stack operations, except for the stack operation that initially created the resource.

SNAPSHOT

For resources that support snapshots (AWS::EC2::Volume, AWS::ElastiCache::CacheCluster, AWS::ElastiCache::ReplicationGroup, AWS::RDS::DBInstance, AWS::RDS::DBCluster, and AWS::Redshift::Cluster), AWS CloudFormation creates a snapshot for the resource before deleting it.

Back to top Generated by DocFX