From 315d168cc01ba5d4870ab244c24f11e3129beb84 Mon Sep 17 00:00:00 2001 From: miyagawa-michiru Date: Sun, 15 May 2022 17:40:14 +0900 Subject: [PATCH 1/3] Add an explanation about the argument 'when' for local-exec --- website/docs/language/resources/provisioners/local-exec.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/docs/language/resources/provisioners/local-exec.mdx b/website/docs/language/resources/provisioners/local-exec.mdx index eda7f9ad01e3..7c66a5648277 100644 --- a/website/docs/language/resources/provisioners/local-exec.mdx +++ b/website/docs/language/resources/provisioners/local-exec.mdx @@ -57,6 +57,12 @@ The following arguments are supported: * `environment` - (Optional) block of key value pairs representing the environment of the executed command. inherits the current process environment. +* `when` - (Optional) If provided, specifies the timing when the command will + be executed. If `when = destroy` is specified, the provisioner will run when + the resource it is defined within is destroyed. See + [Destroy-Time Provisioners](/language/resources/provisioners/syntax#destroy-time-provisioners) + for more details. + ### Interpreter Examples ```hcl From 2bb83244f9eabf7907035592f289487e5cf1b28e Mon Sep 17 00:00:00 2001 From: miyagawa-michiru Date: Wed, 18 May 2022 14:57:46 +0900 Subject: [PATCH 2/3] Update the explanation about 'when' option --- .../docs/language/resources/provisioners/local-exec.mdx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/website/docs/language/resources/provisioners/local-exec.mdx b/website/docs/language/resources/provisioners/local-exec.mdx index 7c66a5648277..ca406c4c4d0d 100644 --- a/website/docs/language/resources/provisioners/local-exec.mdx +++ b/website/docs/language/resources/provisioners/local-exec.mdx @@ -57,11 +57,10 @@ The following arguments are supported: * `environment` - (Optional) block of key value pairs representing the environment of the executed command. inherits the current process environment. -* `when` - (Optional) If provided, specifies the timing when the command will - be executed. If `when = destroy` is specified, the provisioner will run when - the resource it is defined within is destroyed. See - [Destroy-Time Provisioners](/language/resources/provisioners/syntax#destroy-time-provisioners) - for more details. +* `when` - (Optional) If provided, specifies Terraform will execute the command. + For example, `when = destroy` specifies that the provisioner will run when the associated resource + is destroyed. Refer to [Destroy-Time Provisioners](/language/resources/provisioners/syntax#destroy-time-provisioners) + for details. ### Interpreter Examples From 61271ef117a1d74540a0a74551fc75238d5e9d60 Mon Sep 17 00:00:00 2001 From: miyagawa-michiru Date: Thu, 19 May 2022 08:05:34 +0900 Subject: [PATCH 3/3] Add a missing word --- website/docs/language/resources/provisioners/local-exec.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/language/resources/provisioners/local-exec.mdx b/website/docs/language/resources/provisioners/local-exec.mdx index ca406c4c4d0d..261e74cb35e5 100644 --- a/website/docs/language/resources/provisioners/local-exec.mdx +++ b/website/docs/language/resources/provisioners/local-exec.mdx @@ -57,7 +57,7 @@ The following arguments are supported: * `environment` - (Optional) block of key value pairs representing the environment of the executed command. inherits the current process environment. -* `when` - (Optional) If provided, specifies Terraform will execute the command. +* `when` - (Optional) If provided, specifies when Terraform will execute the command. For example, `when = destroy` specifies that the provisioner will run when the associated resource is destroyed. Refer to [Destroy-Time Provisioners](/language/resources/provisioners/syntax#destroy-time-provisioners) for details.