-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Passing value via -var fails #8044
Comments
Passing a map also fails: Now using TF_VAR_somemap as the workaround. |
-var git_sha=9af86eacf7656af1279557d0ab887cc52622f37f in terraform apply causes: Not sure if intended but a fix is to pass the variables as: |
I'm experiencing this as well. Adding a letter to the start or single quoting like @Nomon described works.
|
Adding a letter doesn't seem to be a workaround, as terraform doesn't have any substring function, iiiuc. I'm having trouble coming up with something that works when interpolating in value from the environment, e.g. for:
I'm resorting to generating a script with the command that uses the single quotes, and then calling the script. |
Possibly related, passing a number to a var requires single quoting too, otherwise an error results:
|
@hugoduncan the single quotes are there to prevent shell from eating the double quotes. -var foo="${bar}" should do the same while allowing interpolation. |
when i pass a location to a file as a var it fails as well:
This happens since i upgraded to 0.7.0 |
Looks like it stems from The author explains that a special check was made for CLI supplied variables
Maybe a problem exists in the special check when the variable starts with a number? I'm not too familiar with Go. |
This is correct, what happens is that it tries to load the path i am supplying as a variable to the parseVarFlagAsHCL method which causes it to read it as a file. It shouldn't read it as a file at all since i just want to supply the path as a variable (to provide a path to the credentials file needed to authenticate against google cloud). @jen20 Can you confirm this? I would say this is a critical bug because it makes 0.7.0 unusable for me. |
We noticed this issue at terraform 0.7.2. |
@hugoduncan the issue you're talking about is #7962 |
Because of hashicorp/terraform#8044 we need at least TF 0.7.3
Because of hashicorp/terraform#8044 we need at least TF 0.7.3
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. |
The following command fails with any terraform
.tf
files.I would have expected anything after the
=
to have been assigned to the varimage
.The text was updated successfully, but these errors were encountered: