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
You can limit how many levels of dependencies or dependents to traverse by adding a numeric depth before or after the ellipsis (`...`) operator. This is useful when you only want immediate or nearby relationships rather than the full transitive closure.
520
+
521
+
```bash
522
+
# Find 'service' and only its direct dependencies (1 level deep)
523
+
terragrunt find --filter 'service...1'
524
+
525
+
# Find 'vpc' and only components that directly depend on it (1 level)
526
+
terragrunt find --filter '1...vpc'
527
+
528
+
# Find 'db' with 2 levels of dependencies and 1 level of dependents
529
+
terragrunt find --filter '1...db...2'
530
+
```
531
+
532
+
Given this dependency graph where service depends on db and cache, which both depend on vpc:
<Asidetype="note"title="Multiple Targets and Depth">
561
+
When a filter matches multiple targets, the depth limit applies independently to each target. If a component is reachable from multiple targets at different distances, it will be included if it is within the depth limit of _any_ target.
562
+
563
+
For example, if target A can reach component X in 3 hops and target B can reach X in 1 hop, with a depth limit of 2, X will be included because it is within 2 hops of target B.
564
+
</Aside>
565
+
517
566
<Asidetype="tip">
518
567
Graph expressions require dependency/dependent information to work correctly.
0 commit comments