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

document that destroy provisioners don't run with create_before_destroy #28345

Merged
merged 2 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions website/docs/language/meta-arguments/lifecycle.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ The following arguments can be used within a `lifecycle` block:
such features, so you must understand the constraints for each resource
type before using `create_before_destroy` with it.

Destroy provisioners of this resource will not run if `create_before_destroy`
is used. This limitation may be addressed in the future, see
[GitHub issue](https://github.com/hashicorp/terraform/issues/13549) for details.

yvespp marked this conversation as resolved.
Show resolved Hide resolved
* `prevent_destroy` (bool) - This meta-argument, when set to `true`, will
cause Terraform to reject with an error any plan that would destroy the
infrastructure object associated with the resource, as long as the argument
Expand Down
5 changes: 5 additions & 0 deletions website/docs/language/resources/provisioners/syntax.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ fail, Terraform will error and rerun the provisioners again on the next
`terraform apply`. Due to this behavior, care should be taken for destroy
provisioners to be safe to run multiple times.

Destroy provisioners will not run if the lifecycle Meta-Argument
[`create_before_destroy`](/docs/language/meta-arguments/lifecycle.html) is used
in the resource. This limitation may be addressed in the future, see
[GitHub issue](https://github.com/hashicorp/terraform/issues/13549) for details.
yvespp marked this conversation as resolved.
Show resolved Hide resolved

Destroy-time provisioners can only run if they remain in the configuration
at the time a resource is destroyed. If a resource block with a destroy-time
provisioner is removed entirely from the configuration, its provisioner
Expand Down