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

Terraform Vars Cascade Processing #723

Open
Tensho opened this issue Jun 4, 2019 · 3 comments
Open

Terraform Vars Cascade Processing #723

Tensho opened this issue Jun 4, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@Tensho
Copy link

Tensho commented Jun 4, 2019

Does it make sense to process terraform.tfvars files in all parent directories? Consider the next example:

prod
  us-east-1
    prod
      mysql
        terraform.tfvars # 1 (particular module level variables)
  terraform.tfvars # 2 (region level variable)
terraform.tfvars # 3 (account level variables)

Currently, there is only find_in_parent_folders(), which picks the first found terraform.tfvars file in the parent directories. In the example above we can merge only 1 and 2. It would be nice to adjust the function or create a new one (to not break backward compatibility), which would merge 1, 2, and 3.

People achieve described behavior with the hooks, but I think that should be in the "core".

Here is a comment from other thread describing a similar thing.

@yorinasub17 yorinasub17 added enhancement New feature or request help wanted labels Jun 5, 2019
@brikis98
Copy link
Member

brikis98 commented Jun 5, 2019

Supporting multiple includes was intentionally omitted to avoid over-complicating reasoning about the code, how configs are merged, etc. If we can find a simple way to do it in the future, it may be worth doing it. #707 adds support for it, but #466 needs to be resolved before any new such features.

@jpreese
Copy link

jpreese commented Jul 11, 2019

FWIW I am looking for this functionality as well. Only allowing a single terragrunt.hcl can be very limiting. The scope of what you want to include in the inputs block is going to increase as you traverse deeper into the folder structure (global variables -> region variables -> environment variables -> module variables).

This sort of approach doesn't really seem possible at the moment.

@Tensho
Copy link
Author

Tensho commented Apr 11, 2023

@brikis98 Is it still something that correlates with the future Terragrunt plans?

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

No branches or pull requests

5 participants