aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.55k stars 3.87k forks source link

aws_cdk.RemovalPolicy: Default is stated incorrectly as Destroy #23897

Open sm-javed opened 1 year ago

sm-javed commented 1 year ago

Describe the issue

Destroy is indicated as the default which is incorrect for AWS CDK as can be seen in:

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

pahud commented 1 year ago

Can you share the link where you see the screenshot above? Thanks.

sm-javed commented 1 year ago

https://docs.aws.amazon.com/cdk/v2/guide/resources.html

peterwoodworth commented 1 year ago

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.

sm-javed commented 1 year ago

great, thx @peterwoodworth.