Open sm-javed opened 1 year ago
Can you share the link where you see the screenshot above? Thanks.
The full explanation is that the default depends on the type of resource - a DynamoDB Table and an S3 Bucket will be orphaned by default, but when you delete a CloudFormation stack it's likely that most of the resources will be deleted without setting the retention policy.
The developer guide should accurately explain this. The RemovalPolicy page on API ref should also explain that destroy isn't the default in all cases. However, the S3 API ref is accurate and shouldn't change.
great, thx @peterwoodworth.
Describe the issue
Destroy is indicated as the default which is incorrect for AWS CDK as can be seen in:
CDK Developer Guide RemovalPolicy.RETAIN Keep the contents of the resource when destroying the stack (default). The resource is orphaned from the stack and must be deleted manually. If you attempt to re-deploy the stack while the resource still exists, you will receive an error message due to a name conflict
API reference --> S3/Bucket class that shows: removal_policy (Optional[RemovalPolicy]) removal_policy (Optional[[RemovalPolicy] – Policy to apply when the bucket is removed from this stack. Default: - The bucket will be orphaned.
In essence, Retain is the default, not Destroy.
Could we kindly have this updated. Many thanks for the help.
Links
https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk/RemovalPolicy.html#aws_cdk.RemovalPolicy.DESTROY