Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with find_in_parent_folders function #3185

Open
yadamovych opened this issue Jun 5, 2024 · 0 comments
Open

Issue with find_in_parent_folders function #3185

yadamovych opened this issue Jun 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@yadamovych
Copy link

yadamovych commented Jun 5, 2024

Describe the bug

Hi everyone,

I'm still experiencing this issue with find_in_parent_folders in the latest version.

Seems this is a duplication of #2941

Error:
ERRO[0001] Error: Error in function call
ERRO[0001] on infrastructure/template/main/general/stage/customer-features/eks/k8s/terragrunt.hcl line 6, in locals:
ERRO[0001] 6: account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
ERRO[0001] Call to function "find_in_parent_folders" failed: ParentFileNotFoundError: Could not find an account.hcl in any of the parent folders of saas-test1/infrastructure/template/main/general/stage/network/terragrunt.hcl. Traversed all the way to the root.

Could someone please assist in resolving this?

Thanks for your help!

Steps To Reproduce

In the root of our Git repository, there are folders for deployment and infrastructure. When I execute one of the deployment configurations, it contains a dependency on infrastructure.

dependency "eks" {
  config_path = "../../../../../../../infrastructure/accounts/qa-dev/eu-central-1/devx/customer-features/eks/k8s-main"
}

The dependent infrastructure module includes a template file:

include "template" {
  path = "infrastructure/template/main/general/stage/customer-features/eks/k8s/terragrunt.hcl"
}

The Terragrunt configuration template includes a local block that utilizes the find_in_parent_folders function, which leads to Issues following Terraform version 0.55.1.

locals {
  account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
  region_vars  = read_terragrunt_config(find_in_parent_folders("regional.hcl"))
  stage_vars   = read_terragrunt_config(find_in_parent_folders("stage.hcl"))
}

Config files are located here:
saas-test1/infrastructure/accounts/qa-dev/eu-central-1/devx/stage.hcl
saas-test1/infrastructure/accounts/qa-dev/eu-central-1/regional.hcl
saas-test1/infrastructure/accounts/qa-dev/account.hcl

Expected behavior

Expected the same as in 0.55.1

Versions

  • Terragrunt version: 0.58.14
  • OpenTofu/Terraform version: v1.3.4
  • Environment details (Ubuntu 20.04, Windows 10, etc.): Ubuntu 20.04
@yadamovych yadamovych added the bug Something isn't working label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants