-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
TF_CLI_ARGS errors when CLI command args: []string{"output", "-input=false", "whatever"} #17094
Comments
Hi @nik-shornikov, In general I'd recommend using this environment variable functionality only in very specific situations, such as when running Terraform in automation. As you noted, it can be very confusing if you have variables set in your shell without knowing. This mechanism was added to allow for some unusual use-cases without having to implement a separate environment variable for every possible CLI option. With that said, this mechanism does allow setting commands on a subcommand-specific basis using names of the form |
I also encountered this, though the output in Terraform 0.12.0 did not indicate at first that I had provided an unknown flag. I am using the environment variable for automation purposes, but didn't know about the ability to specify per command, which I will now use. |
Hi folks! The error message has been improved in this situation, and martin provided a solution for per-command variable, so I am going to close this issue. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Using Terraform in a CI environment, we set
TF_CLI_ARGS: "-input=false"
. However, subcommands are inconsistent on the flags they accept. The output subcommand produces:flag provided but not defined: -input
I understand the desire to have environment variable flags exist "upstream", but having ambient conditions result in command help on STDERR for a well-formed command is too opaque.
The text was updated successfully, but these errors were encountered: