Terragrunt: Terragrunt does not allow new `-chdir` option

Created on 15 Dec 2020  路  3Comments  路  Source: gruntwork-io/terragrunt

Terraform 0.14 introduced a new global variable -chdir to allow Terraform to change working directory before executing.

https://www.terraform.io/docs/commands/index.html#switching-working-directory-with-chdir

Terragrunt does not seem to allow this option.

$ terragrunt -chdir=dir plan
Incorrect Usage. flag provided but not defined: -chdir
bug help wanted needs investigation

All 3 comments

Pretty sure terragrunt requires the first argument to be the terraform command... Did you try terragrunt plan -chdir=dir?

Did you try terragrunt plan -chdir=dir?

Yes, this is an illegal Terrraform command since -chdir is a global option and must be put before the command.

$ terragrunt plan -chdir=dir
...
[terragrunt] 2020/12/15 12:29:46 Running command: terraform plan -out=tfplan -chdir=dir
Usage: terraform plan [options] [DIR]
...
[terragrunt] 2020/12/15 12:29:46 Hit multiple errors:
exit status 1

Ah yup terragrunt doesn't support global flags for terraform. This probably needs a little bit of investigation to see where/how terraform global flags should be managed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dingobar picture dingobar  路  3Comments

shaharmor picture shaharmor  路  3Comments

jtai-omniex picture jtai-omniex  路  3Comments

antonbabenko picture antonbabenko  路  3Comments

adborden picture adborden  路  4Comments