gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.06k stars 977 forks source link

Terragrunt graph not working correct with find_in_parent_folders #3002

Open mueller-tobias opened 7 months ago

mueller-tobias commented 7 months ago

Describe the bug We're evaluating terragrunt graph as an alternative to run-all. But it seems to have difficulties with find_in_parent_folders. We've tested a little bit with the example live infrastructure repo but when we run the terragrunt graph plan command for example in the webserver directory

A normal terragrunt run-all plan/apply is working without problems.

Since our production repository is leaned on this example we can't switch/test our pipeline to the new feature.

ERRO[0000] Error: Error in function call
       prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000]   on /tmp/terragrunt-infrastructure-live-example/terragrunt.hcl line 9, in locals:  prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000]    9:   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))  prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000]                                               prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000] Call to function "find_in_parent_folders" failed: ParentFileNotFoundError: Could not find a account.hcl in any of the parent folders of
/tmp/terragrunt-infrastructure-live-example/terragrunt.hcl. Cause: Traversed all the way to the root..
  prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000] Error processing module at '/tmp/terragrunt-infrastructure-live-example/terragrunt.hcl'. How this module was found: Terragrunt config file found in a subdirectory of /tmp/terragrunt-infrastructure-live-example. Underlying error: /tmp/terragrunt-infrastructure-live-example/terragrunt.hcl:9,41-64: Error in function call; Call to function "find_in_parent_folders" failed: ParentFileNotFoundError: Could not find a account.hcl in any of the parent folders of /tmp/terragrunt-infrastructure-live-example/terragrunt.hcl. Cause: Traversed all the way to the root.. 
ERRO[0000] Unable to determine underlying exit code, so Terragrunt will exit with error code 1 

To Reproduce Clone the terragrunt-infrastructure-live-example Repository add the S3 and AWS values and try a terragrunt graph plan

Expected behavior It should run the plan command on all dependencies.

Versions

Nilsas commented 6 months ago

Hi, any ETA on this? would really appreciate moving to graph