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

DeletionPolicy Attribute - Retain #902

Closed
ozbillwang opened this issue Jun 18, 2017 · 8 comments
Closed

DeletionPolicy Attribute - Retain #902

ozbillwang opened this issue Jun 18, 2017 · 8 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. upstream-terraform Addresses functionality related to the Terraform core binary.

Comments

@ozbillwang
Copy link

ozbillwang commented Jun 18, 2017

Hi there,

Terraform Version

all

Affected Resource(s)

Please list the resources as a list, for example:

Terraform lifecycle has three attributes: create_before_destroy, prevent_destroy, ignore_changes, but doesn't support attribute retain which AWS CFN supported.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html

Terraform Configuration Files

resource "aws_s3_bucket" {
   ...
   lifecycle {
     retain = true|false
   }
}

Expected Behavior

Need retain option works as in AWS Cloudformation. Related document is at http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html

To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.

Actual Behavior

No this option

@stack72 stack72 added the enhancement Requests to existing resources that expand the functionality or scope. label Jul 7, 2017
@bflad bflad added the upstream-terraform Addresses functionality related to the Terraform core binary. label Jan 28, 2018
@dreznick
Copy link

Do we know when this going to be available?

@fricanojohnb
Copy link

This is a pretty important thing to have in TF, especially for teams working with extensive data resources. Are there any updates here or is anyone specifically working on adding this yet? This has been stale for almost two years now.

@malachantrio
Copy link

We would very much love this option as well. At the moment we are having to fudge our ci/cd deploy machines permissions so that we remove the ability for terraform to delete certain resources

@saieva
Copy link

saieva commented Sep 24, 2020

Supporting a retain lifecycle would be useful. This might also apply to AWS Elastic IP resources that are used to access services over the Public Internet.

@sethbacon
Copy link

Long-lived databases seem like another good area for this. RDS instances, DynamoDB tables, etc. VPCs might be another resource that is long-lived in some environments and would warrant the Retain support.

@bennettp123
Copy link

bennettp123 commented Dec 4, 2020

This would be useful for our deployment process. It mostly uses terraform, but it also uploads our javascript bundles to S3 with immutable filenames, which are eventually cleaned up by S3 lifecycle policies. We tried using terraform for this, but it deletes previous versions which are gone from the local filesystem, so we're currently using aws-cli instead.

@ewbankkit
Copy link
Contributor

Closing this Issue in this repository.
The requirements have been captured in various internal HashiCorp repository issues dealing with new Terraform lifecycle behaviors.

@github-actions
Copy link

github-actions bot commented Sep 3, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. upstream-terraform Addresses functionality related to the Terraform core binary.
Projects
None yet
Development

No branches or pull requests

10 participants