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

Terragrunt "run-all plan" do not respects TERRAGRUNT_CONFIG env variable #2031

Closed
Nek0trkstr opened this issue Mar 6, 2022 · 6 comments · Fixed by #2704 · May be fixed by #2057
Closed

Terragrunt "run-all plan" do not respects TERRAGRUNT_CONFIG env variable #2031

Nek0trkstr opened this issue Mar 6, 2022 · 6 comments · Fixed by #2704 · May be fixed by #2057
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Nek0trkstr
Copy link

Hi, I've set TERRAGRUNT_CONFIG=.terragrunt.hcl.
So my root and leaf folders have this .terragrunt.hcl file.
Everything works well when I'm trying to run terragrunt from child folder, but I get "Could not find any subfolders with Terragrunt configuration files" error when trying to run from terragrunt run-all plan from root. Renaming .terragrunt.hcl -> terragrunt.hcl fixes the issue, but I would prefer to use "dot" prefix if possible.

It seems like this line is using default config name and not the parsed argument.

@denis256
Copy link
Member

denis256 commented Mar 6, 2022

Hi,
I AFAIK handling of hidden files between modules is not supported - hidden files are simply ignored during initialization of modules.

@Nek0trkstr
Copy link
Author

Hi @denis256, thanks for response.
I think hidden files are still getting passed, because part of my root terragrunt config looks like this, and its working fine:

locals {
  # Automatically load account-level variables
  account_vars = read_terragrunt_config(find_in_parent_folders(".account.hcl"))

  # Automatically load region-level variables
  region_vars = read_terragrunt_config(find_in_parent_folders(".region.hcl"))

  # Extract the variables we need for easy access
  bucket    = local.account_vars.locals.bucket
  region   = local.region_vars.locals.region
}

Meaning I do load hidden files between modules.

@denis256
Copy link
Member

denis256 commented Mar 9, 2022

Hello,
after a couple of tests, I think it is a bug since value of TERRAGRUNT_CONFIG is ignored

@denis256 denis256 added the bug Something isn't working label Mar 9, 2022
@denis256
Copy link
Member

denis256 commented Mar 9, 2022

From what I see, the logic for identification of default terragrunt file should be updated to fetch value from --terragrunt-config / TERRAGRUNT_CONFIG

https://github.com/gruntwork-io/terragrunt/blob/master/config/config.go#L498

https://github.com/gruntwork-io/terragrunt/blob/master/config/config.go#L28

@denis256 denis256 added good first issue Good for newcomers and removed question labels Mar 9, 2022
@Nek0trkstr
Copy link
Author

Hi @denis256, thanks for testing this out!
I see you've labeled it as a "good first issue", I can try and fix that in next couple of days if it's ok.

@levkohimins
Copy link
Contributor

Resolved in v0.50.15 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
3 participants