Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support removalPolicy for stateful resources #188

Closed
flostadler opened this issue Oct 30, 2024 · 2 comments · Fixed by #223
Closed

Support removalPolicy for stateful resources #188

flostadler opened this issue Oct 30, 2024 · 2 comments · Fixed by #223
Assignees
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@flostadler
Copy link
Contributor

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Many stateful resources in the AWS Construct Library accept a removalPolicy as a property, typically defaulting it to RETAIN.

If the AWS Construct Library resource does not accept a removalPolicy argument, users can configure it by using the escape hatch mechanism, as shown in the following example:

cfn_bucket = bucket.node.find_child("Resource")
cfn_bucket.apply_removal_policy(RemovalPolicy.DESTROY)

Right now pulumi-cdk doesn't respect the removal policy and always deletes the resources.

Affected area/feature

@flostadler flostadler added impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features needs-triage Needs attention from the triage team and removed needs-triage Needs attention from the triage team labels Oct 30, 2024
@cleverguy25
Copy link

Added to epic https://github.com/pulumi/home/issues/2191

@corymhall corymhall self-assigned this Nov 15, 2024
corymhall added a commit that referenced this issue Nov 18, 2024
This PR maps CloudFormation [DeletionPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html)
to Pulumi `retainOnDelete`.

**`DeletionPolicy` => `retainOnDelete`**

- `Delete` => `false`
- `Retain` => `true`
- `RetainExceptOnCreate` => `true`
- `Snapshot` => `true`

Looking specifically for validation on `Snapshot` mapping. This
functionality does not exist in Pulumi so I decided to err on the side
of caution and retain the resource instead of deleting it. We log a
warning in this case and they should see the retention in the preview.

closes #188
corymhall added a commit that referenced this issue Nov 18, 2024
This PR maps CloudFormation [DeletionPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html)
to Pulumi `retainOnDelete`.

**`DeletionPolicy` => `retainOnDelete`**

- `Delete` => `false`
- `Retain` => `true`
- `RetainExceptOnCreate` => `true`
- `Snapshot` => `true`

Looking specifically for validation on `Snapshot` mapping. This
functionality does not exist in Pulumi so I decided to err on the side
of caution and retain the resource instead of deleting it. We log a
warning in this case and they should see the retention in the preview.

closes #188
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Nov 18, 2024
@pulumi-bot
Copy link
Contributor

This issue has been addressed in PR #223 and shipped in release v1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants