run-all --terragrunt-include-dir <directory>
processing terragrunt.hcl
in all directories, expected this to only target terragrunt.hcl
in the targeted directory
#3685
Labels
enhancement
New feature or request
performance
Issues related to performance
preserved
Preserved issues never go stale
I have a project structure for hundreds of aws accounts like this:
Each account dir is >90% the same. Customizations to the account are handled by the terraform modules run in each account using tags on accounts and other data sources to do special actions in each account.
terragrunt.hcl
is copied into each account with an account directory generator script, and the entire contents is below:This setup works great for us. From the root directory (
terragrunt_root/
) I can plan / apply a handful of accounts or all accounts withterragrunt run-all ...
optionally with--terragrunt-include-dir account-one
.However, I have noticed that
run-all
commands targeting a small number of accounts still processesterragrunt.hcl
in accounts that are not targeted. This doesnt break anything, but it does make the command run for an unnecessarily long time. We have hundreds of account directories, and just processingterragrunt.hcl
in each directory takes several minutes on my Windows desktop. I have added examplerun-all plan ...
command output with--terragrunt-log-level debug
output below showing the repeated processing ofterragrunt.hcl
in every directory. I did have to replace a lot of strings in the output for sensitivity, but the problem should be clear -terragrunt run-all ...
spends a few minutes processingterragrunt.hcl
in every directory underterragrunt_root/
although I only targeted a single directory. I realize for a single account I could use--terragrunt-working-dir account-one
, but I often plan a handful of accounts withrun-all
.Is processing every
terragrunt.hcl
in every subdirectory related to terragrunt dependency checking? I dont use terragrunt dependencies, so maybe I can disable that? Is there a way to prevent terragrunt from processingterragrunt.hcl
in directories I did not target?The text was updated successfully, but these errors were encountered: