Skip to content

Commit 536e8f3

Browse files
added missing on_failure arg to resource > provisioners docs (#1272)
This PR re-adds the `on_failure` argument that we accidentally excluded during the reference restructure. It addresses issue [1231](#1231).
2 parents 9c105d0 + 24a6e61 commit 536e8f3

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

content/terraform/v1.12.x/docs/language/block/resource.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,29 @@ You cannot add a `scripts` argument in the same provisioner with `inline` or `sc
739739
- Data type: List.
740740
- Default: None.
741741

742+
### `on_failure`
743+
744+
Specifies an action for Terraform to take when a provisioner fails.
745+
746+
```hcl
747+
resource {
748+
# ...
749+
provisioner "<TYPE>" {
750+
on_failure = fail
751+
}
752+
}
753+
```
754+
755+
You can specify one of the following values in `on_failure` argument:
756+
757+
- `continue`: Terraform ignores the error and continues the creation or destruction operation.
758+
- `fail`: Raise an error and stops applying the configuration. Terraform taints the resource when this value is set for a creation provisioner. This is the default.
759+
760+
#### Summary
761+
762+
- Data type: Directive
763+
- Default: `fail`
764+
742765
## Examples
743766

744767
The following examples show how to write configuration for common use cases.

content/terraform/v1.13.x/docs/language/block/resource.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,29 @@ You cannot add a `scripts` argument in the same provisioner with `inline` or `sc
745745
- Data type: List.
746746
- Default: None.
747747

748+
### `on_failure`
749+
750+
Specifies an action for Terraform to take when a provisioner fails.
751+
752+
```hcl
753+
resource {
754+
# ...
755+
provisioner "<TYPE>" {
756+
on_failure = fail
757+
}
758+
}
759+
```
760+
761+
You can specify one of the following values in `on_failure` argument:
762+
763+
- `continue`: Terraform ignores the error and continues the creation or destruction operation.
764+
- `fail`: Raise an error and stops applying the configuration. Terraform taints the resource when this value is set for a creation provisioner. This is the default.
765+
766+
#### Summary
767+
768+
- Data type: Directive
769+
- Default: `fail`
770+
748771
## Examples
749772

750773
The following examples show how to write configuration for common use cases.

content/terraform/v1.14.x (rc)/docs/language/block/resource.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,29 @@ You cannot add a `scripts` argument in the same provisioner with `inline` or `sc
777777
- Data type: List.
778778
- Default: None.
779779

780+
### `on_failure`
781+
782+
Specifies an action for Terraform to take when a provisioner fails.
783+
784+
```hcl
785+
resource {
786+
# ...
787+
provisioner "<TYPE>" {
788+
on_failure = fail
789+
}
790+
}
791+
```
792+
793+
You can specify one of the following values in `on_failure` argument:
794+
795+
- `continue`: Terraform ignores the error and continues the creation or destruction operation.
796+
- `fail`: Raise an error and stops applying the configuration. Terraform taints the resource when this value is set for a creation provisioner. This is the default.
797+
798+
#### Summary
799+
800+
- Data type: Directive
801+
- Default: `fail`
802+
780803
## Examples
781804

782805
The following examples show how to write configuration for common use cases.

0 commit comments

Comments
 (0)