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

read_terragrunt_config fails if referenced file has dependencies #354

Open
mm-nv2020 opened this issue Oct 1, 2024 · 3 comments
Open

read_terragrunt_config fails if referenced file has dependencies #354

mm-nv2020 opened this issue Oct 1, 2024 · 3 comments

Comments

@mm-nv2020
Copy link

Bug report

atlantis.yaml cannot be generated if the child terragrunt.hcl uses read_terragrunt_config function on a file that contains dependencies.

To Reproduce

Summarize how to reproduce the behavior. For example:

  1. clone the example repo
  2. Run the command terragrunt-atlantis-config generate --output atlantis.yaml --filter child/001
  3. if skip_outputs is set to true on dependency caller, there is no error

Expected behavior

No error. I expected the generated Atlantis config to look like:

automerge: false
parallel_apply: true
parallel_plan: true
projects:
- autoplan:
    enabled: false
    when_modified:
    - '*.hcl'
    - '*.tf*'
    - ../../terragrunt.hcl
  dir: child/001
version: 3

Actual behavior

INFO[0000] Could not find an old config file. Starting from scratch 
ERRO[0000] Error: Error in function call
      
ERRO[0000]   on /atlantis_read_terragrunt_config_dependency/child/001/terragrunt.hcl line 6, in locals: 
ERRO[0000]    6:   common = read_terragrunt_config(find_in_parent_folders("common-child.hcl")) 
ERRO[0000]                                              
ERRO[0000] Call to function "read_terragrunt_config" failed: The RunTerragrunt option has not been set on this TerragruntOptions object.
 
ERRO[0000] Encountered error while evaluating locals in file /atlantis_read_terragrunt_config_dependency/child/001/terragrunt.hcl 
Error: /atlantis_read_terragrunt_config_dependency/child/001/terragrunt.hcl:6,12-35: Error in function call; Call to function "read_terragrunt_config" failed: The RunTerragrunt option has not been set on this TerragruntOptions object.

Relevant Terragrunt files
a link to a repository with the smallest set of code needed to reproduce the issue:
https://github.com/kbcz1989/atlantis_read_terragrunt_config_dependency/tree/master

@mm-nv2020 mm-nv2020 reopened this Oct 1, 2024
@cgarcia-l
Copy link

Hi, I'm currently experiencing the same issue. Unfortunately, I haven't found a useful solution so far. I'll keep looking and update here if I come across anything that works.

@Sancretor
Copy link
Contributor

Hi !
I just got the same issue and will try to do some debug in the coming weeks.

@Sancretor
Copy link
Contributor

It looks like it's coming from the Terragrunt old version used inside the tool, I was able to reproduce it with Terragrunt v0.54.1 directly.
I tried to upgrade this dependency but looks like too much stuff has changed in between, so it's not that easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants