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

Feature Request: Custom destroy operations #12319

Closed
mengesb opened this issue Mar 1, 2017 · 2 comments
Closed

Feature Request: Custom destroy operations #12319

mengesb opened this issue Mar 1, 2017 · 2 comments

Comments

@mengesb
Copy link
Contributor

mengesb commented Mar 1, 2017

Greetings,

I searched a bit and recall that I wanted to see this some time back however I'm not sure I'm searching for the right thing. This is similar to #8144 I believe, except a little more directed.

Similar to the use case mentioned (used to deprovision hosts from Chef), I would like custom defined destroy actions that follow the remote-exec or local-exec style provisioners.

Essentially when Terraform runs it's destroy operation, not all things are cleaned up. For instance, I have no way to trigger a re-invocation of a null_resource executing a consul client in a docker container who's runtime just changed. Terraform correctly re-creates it, but it is up to me to taint the related null_resource to then run apply so it runs again.

Other things are like that of locally created files. I have a lot of local path setup running that upon destroy I don't want Terraform leaving around. I'd like some "on destroy" actions where I can define steps to perform further cleanup operations.

@jbardin
Copy link
Member

jbardin commented Mar 2, 2017

Hi @mengesb,

"destroy provisioners" are a new feature that will be coming in the 0.9 release.

There will be 2 new options in the lifecycle, when to declare when the provisioner runs, and on_failure to determine how to handle provisioner failure.

 when = "create"|"destroy"
 on_failure = "continue"|"fail"

@jbardin jbardin closed this as completed Mar 2, 2017
@ghost
Copy link

ghost commented Apr 16, 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 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants