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: docs-starlight/src/content/docs/04-reference/01-hcl/02-blocks.mdx
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1488,9 +1488,10 @@ Syntax:
1488
1488
# terragrunt.hcl
1489
1489
1490
1490
exclude {
1491
-
if = <boolean expression> # Boolean expression to determine exclusion.
1492
-
actions = ["<action>", ...] # List of actions to exclude (e.g., "plan", "apply", "all", "all_except_output").
1493
-
exclude_dependencies = <boolean> # Boolean to determine if dependencies should also be excluded.
1491
+
if = <boolean> # Boolean to determine exclusion.
1492
+
no_run = <boolean> # Boolean to prevent the unit from running (even when not using `--all`).
1493
+
actions = ["<action>", ...] # List of actions to exclude (e.g., "plan", "apply", "all", "all_except_output").
1494
+
exclude_dependencies = <boolean> # Boolean to determine if dependencies should also be excluded.
1494
1495
}
1495
1496
```
1496
1497
@@ -1501,6 +1502,7 @@ Attributes:
1501
1502
|`if`| boolean | Condition to dynamically determine whether the unit should be excluded. |
1502
1503
|`actions`| list(string) | Specifies which actions to exclude when the condition is met. Options: `plan`, `apply`, `all`, `all_except_output` etc. |
1503
1504
|`exclude_dependencies`| boolean | Indicates whether the dependencies of the excluded unit should also be excluded (default: `false`). |
1505
+
|`no_run`| boolean | When `true` and `if` is `true`, prevents the unit from running entirely for both single unit commands and `run --all` commands, but only when the current action matches the `actions` list. |
1504
1506
1505
1507
Examples:
1506
1508
@@ -1542,6 +1544,18 @@ exclude {
1542
1544
1543
1545
This setup is useful for scenarios where output evaluation is still needed, even if other actions like `plan` or `apply` are excluded.
1544
1546
1547
+
```hcl
1548
+
# terragrunt.hcl
1549
+
1550
+
exclude {
1551
+
if = true
1552
+
no_run = true
1553
+
actions = ["plan"]
1554
+
}
1555
+
```
1556
+
1557
+
This configuration prevents the unit from running when `if` is `true` AND the current action is "plan". The `no_run` attribute works for both single unit commands (like `terragrunt plan`) and `run --all` commands (like `terragrunt run --all plan`), but only when the current action matches the `actions` list.
1558
+
1545
1559
Consider using this for units that are expensive to continuously update, and can be opted in when necessary.
Copy file name to clipboardExpand all lines: docs/_docs/04_reference/04-config-blocks-and-attributes.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1494,9 +1494,10 @@ Syntax:
1494
1494
1495
1495
```hcl
1496
1496
exclude {
1497
-
if = <boolean expression> # Boolean expression to determine exclusion.
1498
-
actions = ["<action>", ...] # List of actions to exclude (e.g., "plan", "apply", "all", "all_except_output").
1499
-
exclude_dependencies = <boolean> # Boolean to determine if dependencies should also be excluded.
1497
+
if = <boolean> # Boolean to determine exclusion.
1498
+
no_run = <boolean> # Boolean to prevent the unit from running (even when not using `--all`).
1499
+
actions = ["<action>", ...] # List of actions to exclude (e.g., "plan", "apply", "all", "all_except_output").
1500
+
exclude_dependencies = <boolean> # Boolean to determine if dependencies should also be excluded.
1500
1501
}
1501
1502
```
1502
1503
@@ -1507,6 +1508,7 @@ Attributes:
1507
1508
|`if`| boolean | Condition to dynamically determine whether the unit should be excluded. |
1508
1509
|`actions`| list(string) | Specifies which actions to exclude when the condition is met. Options: `plan`, `apply`, `all`, `all_except_output` etc. |
1509
1510
|`exclude_dependencies`| boolean | Indicates whether the dependencies of the excluded unit should also be excluded (default: `false`). |
1511
+
|`no_run`| boolean | When `true` and `if` is `true`, prevents the unit from running entirely for both single unit commands and `run --all` commands, but only when the current action matches the `actions` list. |
1510
1512
1511
1513
Examples:
1512
1514
@@ -1542,6 +1544,16 @@ exclude {
1542
1544
1543
1545
This setup is useful for scenarios where output evaluation is still needed, even if other actions like `plan` or `apply` are excluded.
1544
1546
1547
+
```hcl
1548
+
exclude {
1549
+
if = true
1550
+
no_run = true
1551
+
actions = ["plan"]
1552
+
}
1553
+
```
1554
+
1555
+
This configuration prevents the unit from running when `if` is `true` AND the current action is "plan". The `no_run` attribute works for both single unit commands (like `terragrunt plan`) and `run --all` commands (like `terragrunt run --all plan`), but only when the current action matches the `actions` list.
1556
+
1545
1557
Consider using this for units that are expensive to continuously update, and can be opted in when necessary.
0 commit comments