Skip to content

Commit d3d4145

Browse files
authored
File dependency docs (#2408)
* WIP - File dependency docs * Mark the old enable provider cache config as deprecated in favor of env * explicitly call out DAG generators * Update file-dependencies.md * Update file-dependencies.md Platform agnostic language
1 parent f102e3a commit d3d4145

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Running Pipelines for Changes to non-IaC file dependencies
2+
3+
Pipelines runs plan/applies based on changes to your units in your IaC repository. Intuitively, if you make a change to `path/to/my/unit/terragrunt.hcl` then Pipelines will run plan/apply in `/path/to/my/unit`. Pipelines also supports running `run-all` when [consolidation](/2.0/reference/pipelines/configurations-as-code/api#consolidate_added_or_changed) is enabled.
4+
5+
However, there are some cases where you may want to run Pipelines for changes to files that are not part of your IaC. For example, you may have a `terragrunt.hcl` file that imports data from a `tags.yaml` file. If you make a change to the `tags.yaml` file, you may want to run Pipelines to plan/apply the changes to the associated `terragrunt.hcl` file. This page documents how to configure pipelines to automatically run `plan/apply` when only these data files are changed.
6+
7+
## Configuration
8+
9+
Pipelines will automatically detect, based on git commit history, when data files have changed and emit a `FileChanged` change. This will create a new execution in your CI flow that will invoke Terragrunt with the [`queue-include-units-reading`](https://terragrunt.gruntwork.io/docs/reference/cli-options/#queue-include-units-reading) option set to the files that have changed. Terragrunt will then scan your code for units that depend on the changed files and add them to the plan/apply.
10+
11+
Note that Terragrunt will only be able to determine which units read the data file if that file is read using a built-in function such as `read_terragrunt_config` or is in a `include`, `dependency`, or `dependencies` block. You may want to use the [`mark_as_read`](https://terragrunt.gruntwork.io/docs/reference/built-in-functions/#mark_as_read) function to explicitly ensure that Terragrunt knows to include your unit when a particular data file is changed.
12+
13+
## Example
14+
15+
Here's an example of how to configure pipelines to automatically run `plan/apply` when only these data files are changed.

docs/2.0/reference/pipelines/configurations.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,6 @@ pipelines:
8989
</HclListItemExample>
9090
</HclListItem>
9191
92-
#### enable-terragrunt-provider-cache
93-
94-
<HclListItem name="enable-terragrunt-provider-cache" requirement="optional" type="boolean">
95-
<HclListItemDescription>
96-
Enables the <span class="external-link"><a href="https://terragrunt.gruntwork.io/docs/features/provider-cache/">Terragrunt Provider Cache</a></span> for plans and applies.
97-
</HclListItemDescription>
98-
<HclListItemDefaultValue defaultValue="false"/>
99-
<HclListItemExample>
100-
101-
```yaml
102-
pipelines:
103-
enable-terragrunt-provider-cache: true
104-
```
105-
106-
</HclListItemExample>
107-
</HclListItem>
10892
10993
#### env
11094
@@ -194,6 +178,25 @@ pipelines:
194178
195179
## Deprecated Configuration Options
196180
181+
#### enable-terragrunt-provider-cache
182+
183+
<HclListItem name="enable-terragrunt-provider-cache" requirement="optional" type="boolean">
184+
<HclListItemDescription>
185+
Enables the <span class="external-link"><a href="https://terragrunt.gruntwork.io/docs/features/provider-cache/">Terragrunt Provider Cache</a></span> for plans and applies.
186+
187+
This option is deprecated in favor of setting `TERRAGRUNT_PROVIDER_CACHE` as an [`env`](#env) option.
188+
</HclListItemDescription>
189+
<HclListItemDefaultValue defaultValue="false"/>
190+
<HclListItemExample>
191+
192+
```yaml
193+
pipelines:
194+
enable-terragrunt-provider-cache: true
195+
```
196+
197+
</HclListItemExample>
198+
</HclListItem>
199+
197200
#### cli-version
198201

199202
<HclListItem name="cli-version" requirement="deprecated" type="string">

sidebars/docs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ const sidebar = [
314314
type: "doc",
315315
id: "2.0/docs/pipelines/guides/running-drift-detection",
316316
},
317+
{
318+
label: "File Dependencies",
319+
type: "doc",
320+
id: "2.0/docs/pipelines/guides/file-dependencies",
321+
},
317322
{
318323
label: "Leveraging advanced Terragrunt Features",
319324
type: "doc",

0 commit comments

Comments
 (0)