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

EFS Removal Policy #6757

Open
misterjoshua opened this issue Mar 17, 2020 · 1 comment
Open

EFS Removal Policy #6757

misterjoshua opened this issue Mar 17, 2020 · 1 comment

Comments

@misterjoshua
Copy link

@misterjoshua misterjoshua commented Mar 17, 2020

I'd like to be able to set a removal policy for an EfsFileSystem and for the default removal policy to be "RETAIN" instead of "DESTROY".

Use Case

In my pipeline for a named environment ("test", "staging", "production") I want EFS FileSystems to survive accidental stack deletion and changes to my construct that might result in the FileSystem being gone forever. However, when my pipeline is working in a branch environment, I'd like a stack deletion to remove the EFS FileSystem as the branches are much shorter-lived.

Proposed Solution

I think an EfsFileSystem prop that provides a removalPolicy like RDS would work for me.

I also think that this feature should default to a removal policy of "RETAIN" to be consistent with DynamoDB Tables and RDS Instances. This is probably a breaking change, but it's pretty early days in this experimental module. My reasoning is that the EFS file system may contain data that the user doesn't want to lose if they accidentally cause the resource to vanish during a deploy.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@rix0rrr

This comment has been minimized.

Copy link
Contributor

@rix0rrr rix0rrr commented Mar 19, 2020

Yep, sounds like a good idea.

As a workaround until this feature lands, you can access the filesystem.node.defaultChild, cast it to a CfnResource, and set the removal policy there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.