You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/terraform/v1.12.x/docs/language/block/resource.mdx
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -739,6 +739,29 @@ You cannot add a `scripts` argument in the same provisioner with `inline` or `sc
739
739
- Data type: List.
740
740
- Default: None.
741
741
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
+
742
765
## Examples
743
766
744
767
The following examples show how to write configuration for common use cases.
Copy file name to clipboardExpand all lines: content/terraform/v1.13.x/docs/language/block/resource.mdx
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -745,6 +745,29 @@ You cannot add a `scripts` argument in the same provisioner with `inline` or `sc
745
745
- Data type: List.
746
746
- Default: None.
747
747
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
+
748
771
## Examples
749
772
750
773
The following examples show how to write configuration for common use cases.
Copy file name to clipboardExpand all lines: content/terraform/v1.14.x (rc)/docs/language/block/resource.mdx
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -777,6 +777,29 @@ You cannot add a `scripts` argument in the same provisioner with `inline` or `sc
777
777
- Data type: List.
778
778
- Default: None.
779
779
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
+
780
803
## Examples
781
804
782
805
The following examples show how to write configuration for common use cases.
0 commit comments