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

Behaviour of prevent_destroy lifecycle rule #18481

Closed
endofcake opened this issue Jul 18, 2018 · 2 comments
Closed

Behaviour of prevent_destroy lifecycle rule #18481

endofcake opened this issue Jul 18, 2018 · 2 comments

Comments

@endofcake
Copy link
Contributor

Hi,

Lifecycle meta-parameter looks like it could be used to prevent some accidental destructive changes. I can set

prevent_destroy = "true"

and it does indeed cause an error if I run terraform destroy.

However, if I remove the configuration of this resource and then run terraform apply, Terraform would happily proceed to remove the resource.

Is this the intended behaviour? Should there be a way to prevent destruction of resources similar to CloudFormation stack policies? Terraform could store this setting in the state file , so that even if a resource is deleted from the configuration, Terraform would still know that it's destruction used to be explicitly denied.

Thanks.

@jbardin
Copy link
Member

jbardin commented Jul 19, 2018

Thanks for filing the issue. We're currently tracking this in #17599

@jbardin jbardin closed this as completed Jul 19, 2018
@ghost
Copy link

ghost commented Apr 2, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants