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
When executing run-all plan (or apply) even with --terragrunt-ignore-external-dependencies, both package and state file of indirect dependencies is also being fetched. This causes execution time to increase vastly.
Consider a module my-app/terragrunt.hcl has dependencies for my-cluster/ and my-defs/, and my-cluster/terragrunt.hcl has dependency for my-vpc/.
Executing a run-all plan on my-app/ should not need to install modules nor fetch state files of my-vpc/.
Expected behavior
Only fetch state of the direct dependencies.
Versions
Terragrunt version: v0.68.4
OpenTofu/Terraform version: v1.9.8
Environment details (Ubuntu 20.04, Windows 10, etc.): Debian 11
The text was updated successfully, but these errors were encountered:
Hello,
try setting env variable TERRAGRUNT_STRICT_CONTROL="skip-dependencies-inputs", it will improve performance at cost of skipping dependency inputs
We had a chat about this, and while the strict control that @denis256 mentioned does provide some optimizations for recursive fetching of dependencies it doesn't fully resolve the issue you're mentioning.
Terragrunt still inits in an ancestor dependency when it doesn't have to because of how it parses Terragrunt configurations (the relevant relatively inefficient code block is probably this one). While parsing the terragrunt.hcl file for a direct dependency to determine how to fetch outputs, Terragrunt ends up recursively traversing through ancestors to parse their configurations.
Preventing this behavior is going to take some adjustment in how we parse HCL configurations to do so safely, so please have patience as we look to resolve this issue. Of course, if you have your own thoughts on how to resolve this, you're welcome to submit a pull request!
Describe the bug
When executing
run-all plan
(orapply
) even with--terragrunt-ignore-external-dependencies
, both package and state file of indirect dependencies is also being fetched. This causes execution time to increase vastly.Consider a module
my-app/terragrunt.hcl
has dependencies formy-cluster/
andmy-defs/
, andmy-cluster/terragrunt.hcl
has dependency formy-vpc/
.Executing a
run-all plan
onmy-app/
should not need to install modules nor fetch state files ofmy-vpc/
.Expected behavior
Only fetch state of the direct dependencies.
Versions
The text was updated successfully, but these errors were encountered: