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

Add .terragruntrc.json Support #3572

Open
mossad-zika opened this issue Nov 16, 2024 · 3 comments
Open

Add .terragruntrc.json Support #3572

mossad-zika opened this issue Nov 16, 2024 · 3 comments
Labels
enhancement New feature or request preserved Preserved issues never go stale

Comments

@mossad-zika
Copy link

mossad-zika commented Nov 16, 2024

this is a duplicate of #2849

Currently, Terragrunt is able to pass extra arguments and set environment variables for Terraform using hooks or run_cmd() command. However, this does not work for Terragrunt itself.

For example, we constantly have to type terragrunt run-all plan --terragrunt-non-interactive, whereas I would want to set this flag in terragrunt.hcl file (or as an env var TERRAGRUNT_NON_INTERACTIVE=true) and have Terragrunt honour it.

Describe alternatives you've considered

  1. Wrapper for terragrunt executables, such as Makefiles and bash scripts - but those are messy.
  2. Setting TERRAGRUNT_ variables manually on the CLI before running Terragrunt but, again, yet another step and more typing that shouldn't be needed.

Additional context If there's any way to set Terragrunt defaults within itself, that would be great as the number of options is growing and can make for a messy and long command line.

@mossad-zika mossad-zika added the enhancement New feature or request label Nov 16, 2024
@yhakbar yhakbar added the preserved Preserved issues never go stale label Nov 19, 2024
@yhakbar
Copy link
Collaborator

yhakbar commented Nov 19, 2024

Hey @mossad-zika , we've talked about this internally, and we have some designs in mind.

The design that we're considering right now is basically to have a .terragruntrc.json file that can go in places you would typically expect it:

  1. Current working directory.
  2. Root of repository.
  3. In .config directory at root of repository.
  4. Home directory of user.

The file would be parsed, then set Terragrunt flags with names that match the names of flags, so it would be pretty easy to guess how configurations would be set.

In the future there may be other configurations that we'd add to this, but that's our general thought process right now.

Marking the issue as preserved, as we plan to address this, but it's just not a top priority right now.

If you would like this issue resolved earlier, consider cutting a pull request to deliver this.

@BeyondEvil
Copy link

Yes! This!

And please please please use JSON and not yaml 😅

@yhakbar yhakbar changed the title Set Terragrunt defaults in terragrunt.hcl file Add .terragruntrc.json Support Dec 20, 2024
@yhakbar
Copy link
Collaborator

yhakbar commented Dec 20, 2024

Something to consider is that this is becoming more important, as we're evaluating changing some defaults in how Terragrunt behaves.

This flag, for example, is not a great default for Terragrunt to have, but is also non-trivial to remove.

It's nice for users to have that check happen whenever they try to destroy something, and it's only useful when users don't know that there's a dependency on something they're destroying, so it's not great to opt-in to that functionality. We could have some recommended .terragruntrc.json files in the docs for that feature that explicitly enable the check for users that are willing to accept the performance penalty.

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

No branches or pull requests

3 participants