Open joaocc opened 2 weeks ago
Hello,
try setting env variable TERRAGRUNT_STRICT_CONTROL="skip-dependencies-inputs"
, it will improve performance at cost of skipping dependency inputs
Thanks. I was reading the docs and I am not sure if I am able to interpret correctly what this does.
Hey @joaocc ,
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 arun-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