File tree Expand file tree Collapse file tree 4 files changed +116
-0
lines changed Expand file tree Collapse file tree 4 files changed +116
-0
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,36 @@ description: |-
10
10
11
11
Causes an error to be thrown if the condition is true.
12
12
13
+ ## Example Usage
13
14
15
+ ``` terraform
16
+ variable "one" {}
17
+ variable "two" {}
18
+
19
+ data "validation_errors" "errs" {
20
+
21
+ error {
22
+ condition = var.one == var.two
23
+ summary = "var.one and var.two must never be equal"
24
+ details = <<EOF
25
+ When var.one and var.two are equal, bad things can happen.
26
+ Please use differing values for these inputs.
27
+ var.one: ${var.one}
28
+ var.two: ${var.two}
29
+ EOF
30
+ }
31
+
32
+ error {
33
+ condition = var.one % 2 == 0
34
+ summary = "var.one cannot be even"
35
+ }
36
+
37
+ error {
38
+ condition = var.two % 2 != 0
39
+ summary = "var.two cannot be odd"
40
+ }
41
+ }
42
+ ```
14
43
15
44
<!-- schema generated by tfplugindocs -->
16
45
## Schema
Original file line number Diff line number Diff line change @@ -10,7 +10,36 @@ description: |-
10
10
11
11
Causes one or more warnings to be shown if the condition is true.
12
12
13
+ ## Example Usage
13
14
15
+ ``` terraform
16
+ variable "one" {}
17
+ variable "two" {}
18
+
19
+ data "validation_warnings" "warns" {
20
+
21
+ warning {
22
+ condition = var.one == var.two
23
+ summary = "var.one and var.two are equal. This will cause an error in future versions"
24
+ details = <<EOF
25
+ In a future release of this code, var.one and var.two may no longer be equal.
26
+ Please consider modifying the values to avoid execution failures.
27
+ var.one: ${var.one}
28
+ var.two: ${var.two}
29
+ EOF
30
+ }
31
+
32
+ warning {
33
+ condition = var.one % 2 == 0
34
+ summary = "var.one should not be even"
35
+ }
36
+
37
+ warning {
38
+ condition = var.two % 2 != 0
39
+ summary = "var.two should not be odd"
40
+ }
41
+ }
42
+ ```
14
43
15
44
<!-- schema generated by tfplugindocs -->
16
45
## Schema
Original file line number Diff line number Diff line change @@ -10,7 +10,36 @@ description: |-
10
10
11
11
Causes one or more errors to be thrown during execution if the condition is true
12
12
13
+ ## Example Usage
13
14
15
+ ``` terraform
16
+ variable "one" {}
17
+ variable "two" {}
18
+
19
+ resource "validation_errors" "errs" {
20
+
21
+ error {
22
+ condition = var.one == var.two
23
+ summary = "var.one and var.two must never be equal"
24
+ details = <<EOF
25
+ When var.one and var.two are equal, bad things can happen.
26
+ Please use differing values for these inputs.
27
+ var.one: ${var.one}
28
+ var.two: ${var.two}
29
+ EOF
30
+ }
31
+
32
+ error {
33
+ condition = var.one % 2 == 0
34
+ summary = "var.one cannot be even"
35
+ }
36
+
37
+ error {
38
+ condition = var.two % 2 != 0
39
+ summary = "var.two cannot be odd"
40
+ }
41
+ }
42
+ ```
14
43
15
44
<!-- schema generated by tfplugindocs -->
16
45
## Schema
Original file line number Diff line number Diff line change @@ -10,7 +10,36 @@ description: |-
10
10
11
11
Causes one or more warnings to be shown during execution if the condition is true.
12
12
13
+ ## Example Usage
13
14
15
+ ``` terraform
16
+ variable "one" {}
17
+ variable "two" {}
18
+
19
+ resource "validation_warnings" "warns" {
20
+
21
+ warning {
22
+ condition = var.one == var.two
23
+ summary = "var.one and var.two are equal. This will cause an error in future versions"
24
+ details = <<EOF
25
+ In a future release of this code, var.one and var.two may no longer be equal.
26
+ Please consider modifying the values to avoid execution failures.
27
+ var.one: ${var.one}
28
+ var.two: ${var.two}
29
+ EOF
30
+ }
31
+
32
+ warning {
33
+ condition = var.one % 2 == 0
34
+ summary = "var.one should not be even"
35
+ }
36
+
37
+ warning {
38
+ condition = var.two % 2 != 0
39
+ summary = "var.two should not be odd"
40
+ }
41
+ }
42
+ ```
14
43
15
44
<!-- schema generated by tfplugindocs -->
16
45
## Schema
You can’t perform that action at this time.
0 commit comments