From c6de87354ae664879237cf11411a22393ac0cef6 Mon Sep 17 00:00:00 2001 From: Yves Peter Date: Tue, 13 Apr 2021 10:26:32 +0200 Subject: [PATCH] document that destroy provisioners don't run with create_before_destroy --- website/docs/language/meta-arguments/lifecycle.html.md | 4 ++++ website/docs/language/resources/provisioners/syntax.html.md | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/website/docs/language/meta-arguments/lifecycle.html.md b/website/docs/language/meta-arguments/lifecycle.html.md index 6671ff3b3..afa726cee 100644 --- a/website/docs/language/meta-arguments/lifecycle.html.md +++ b/website/docs/language/meta-arguments/lifecycle.html.md @@ -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. + * `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 diff --git a/website/docs/language/resources/provisioners/syntax.html.md b/website/docs/language/resources/provisioners/syntax.html.md index 3a8eb95eb..171f3fe13 100644 --- a/website/docs/language/resources/provisioners/syntax.html.md +++ b/website/docs/language/resources/provisioners/syntax.html.md @@ -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. + 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