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

Supplying custom terraform binary via --terragrunt-tfpath breaks terraform #265

Open
jcharette opened this issue Aug 16, 2017 · 9 comments
Labels
bug Something isn't working

Comments

@jcharette
Copy link

Supplying the --terragrunt-tfpath= argument to terragrunt breaks terraform. The variable is passed down to the terraform spawn, and then terraform fails due to invalid arguments.

example:

./terragrunt_darwin_amd64 plan-all --terragrunt-tfpath=pwd/terraform

[terragrunt] [/Users/jcharette/vbustash/ox/tf_live/dev/alb] 2017/08/16 07:28:39 Running command: terraform plan -var-file=/Users/jcharette/vbustash/ox/tf_live/dev/alb/terraform.tfvars --terragrunt-tfpath=/Users/jcharette/vbustash/ox/tf_live/dev/terraform
[terragrunt] [/Users/jcharette/vbustash/ox/tf_live/dev/alb] 2017/08/16 07:28:39 Module /Users/jcharette/vbustash/ox/tf_live/dev/alb has finished with an error: exit status 1

Running the same plan without the --terragrunt-tfpath argument succeeds with no errors.

@brikis98 brikis98 added bug Something isn't working help wanted labels Aug 16, 2017
@brikis98
Copy link
Member

Sounds like a bug! Teragrunt args should be filtered out here:

https://github.com/gruntwork-io/terragrunt/blob/master/cli/args.go#L138

Perhaps something broke with that code. PRs are welcome!

@WalkerGriggs
Copy link

I am running into the same issue. If I use --terragrunt-tfpath=xxx before plan, I get

Incorrect Usage. flag provided but not defined: -terragrunt-tfpath

But, if I pass 'path' before the terragrunt flag, it gets passed to the terraform command.

@efreedom79
Copy link

Don't know if it's related but Yori asked me to log it. Basically Trying using --terragrunt-tfpath seems to fail while using TERRAGRUNT_PATH, things work better. He said "hat definitely looks like a bug. Specifically, it looks like we forgot to mark terragrunt-tfpath as a terragrunt specific arg. Can you file an issue in the Github repo (https://github.com/gruntwork-io/terragrunt)? In the meantime, can you try using the environment variable TERRAGRUNT_TFPATH (and setting it to /usr/local/bin/tfpath/0.11.7/terraform) as a workaround? (edited) "

@xyklex
Copy link

xyklex commented Jul 15, 2019

Updating this issue, the flag --terragrunt-tfpath is passed down to terraform and still breaking, only works with the TERRAGRUNT_TFPATH env variable, tested on v0.19.8

@veggiemonk
Copy link

veggiemonk commented Aug 7, 2019

The bug appeared today for me as well. Setting the environmental variable TERRAGRUNT_TFPATH worked. Thanks @xyklex

@yorinasub17
Copy link
Contributor

While this particular bug still exists, there is a new workaround now: you can set the terraform_binary attribute to control from terragrunt.hcl as well (https://github.com/gruntwork-io/terragrunt#terraform_binary)

@dmead
Copy link

dmead commented Aug 19, 2020

same issue for me

@Tarasovych
Copy link
Contributor

Still an issue:

terragrunt_v0.29.2 --terragrunt-tfpath "/usr/local/bin/terraform_0.15.1" terragrunt-info
Incorrect Usage. flag provided but not defined: -terragrunt-tfpath

@yorinasub17
Copy link
Contributor

@Tarasovych Terragrunt flags must come after the command, so you need to do terragrunt_v0.29.2 terragrunt-info --terragrunt-tfpath "/usr/local/bin/terraform_0.15.1".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants