Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Terraform console doesn't accept -var-file and -var #21483

Closed
mdibaiee opened this issue May 28, 2019 · 1 comment · Fixed by #22145
Closed

Terraform console doesn't accept -var-file and -var #21483

mdibaiee opened this issue May 28, 2019 · 1 comment · Fixed by #22145
Labels
bug cli v0.12 Issues (primarily bugs) reported against v0.12 releases

Comments

@mdibaiee
Copy link

mdibaiee commented May 28, 2019

Terraform Version

Terraform v0.12.0

Terraform Configuration Files

N/A

Debug Output

2019/05/28 18:58:08 [INFO] Terraform version: 0.12.0
2019/05/28 18:58:08 [INFO] Go runtime version: go1.12.5
2019/05/28 18:58:08 [INFO] CLI args: []string{"/usr/bin/terraform", "console", "-var", "test=\"a\""}
2019/05/28 18:58:08 [DEBUG] Attempting to open CLI config file: /home/mahdi/.terraformrc
2019/05/28 18:58:08 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/05/28 18:58:08 [INFO] CLI command args: []string{"console", "-var", "test=\"a\""}
Usage: terraform console [options] [DIR]

  Starts an interactive console for experimenting with Terraform
  interpolations.

  This will open an interactive console that you can use to type
  interpolations into and inspect their values. This command loads the
  current state. This lets you explore and test interpolations before
  using them in future configurations.

  This command will never modify your state.

  DIR can be set to a directory with a Terraform state to load. By
  default, this will default to the current working directory.

Options:

  -state=path            Path to read state. Defaults to "terraform.tfstate"

  -var 'foo=bar'         Set a variable in the Terraform configuration. This
                         flag can be set multiple times.

  -var-file=foo          Set variables in the Terraform configuration from
                         a file. If "terraform.tfvars" or any ".auto.tfvars"
                         files are present, they will be automatically loaded.

Crash Output

Expected Behavior

Terraform console should support -var-file and -var as stated in the help, and as was in the past versions. There is no note of this in the changelog either. We rely heavily on this feature.

Actual Behavior

Terraform console seems to support only -state and not -var-file or -var.

Steps to Reproduce

  1. terraform console -var "test='a'"

Additional Context

References

This seems to have been caused in this commit: ef90545

Specifically, this change:
image

@ghost
Copy link

ghost commented Oct 7, 2019

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.

@ghost ghost locked and limited conversation to collaborators Oct 7, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug cli v0.12 Issues (primarily bugs) reported against v0.12 releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants