We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
we have value of variable which we pass from gitlab secrets and running tftree it requires it and tftree fails.
➜ git: ✗ tftree Running "terraform init"... Running "terraform plan"... ╷ │ Error: │ │ Command "/Users/bin/terraform" with args ["terraform" "plan" "-out" "/var/folders/dl/slnh1vrd4nq2fs6r6vz2fqg40000gn/T/tftree.93526139.plan"] failed: exit status 1 │ Command output: │ var.apikey │ (required) API key │ │ Enter a value: ╷ │ │ Error: No value for required variable │ │ │ │ on _variables.tf line 1: │ │ 1: variable "apikey" { │ │
The text was updated successfully, but these errors were encountered:
Hi @fogers777, thanks for coming forward!
This is already possible, although I admit it should be documented. My bad.
Terraform supports setting variables in the environment. For example, to set the foo variable to bar:
foo
bar
TF_VAR_foo=bar tftree
Similarly, you can set flags for specific commands. To use the -var-file flag:
-var-file
TF_CLI_ARGS_plan="-var-file=production.tfvars" tftree
The complete list of available environment variables is in Terraform's documentation here: https://developer.hashicorp.com/terraform/cli/config/environment-variables
I hope this solves your issue. Let me know if it does 🙂
Sorry, something went wrong.
Thank you @busser, got it working now ;)
No branches or pull requests
we have value of variable which we pass from gitlab secrets and running tftree it requires it and tftree fails.
The text was updated successfully, but these errors were encountered: