-
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
Error: Unassigned variable #21659
Comments
I believe i was also seeing this issue after upgrading terraform to 0.12. Here is the travis build where we began seeing the errors in our acceptance tests. https://travis-ci.org/nukosuke/terraform-provider-zendesk/jobs/537885423 Diff is here. nukosuke/terraform-provider-zendesk@c417e18...efe8126. |
HI @Meemaw, All variables require value, either provided via a default, the cli, a tfvars file, or interactively. If there's no value provided, and you are using |
@jbardin if you look at the build link above you can see that the environment variables being passed to terraform an I can confirm that this only occurs after upgrading to 0.12 |
While it's true that all variables do need to be assigned, this error is reporting that variable values are not being passed properly around inside Terraform Core itself. IIRC it arises when The message suggests that there's a bug in the variable-checking and/or variable-handling code in either the |
Hi @tamccall, Sorry, I didn't see your addition here for some reason. The original error here looks like variables missing from the config or cli, while yours is coming from the plugin test fixture. I that may be more closely related to the issue about |
@jbardin Ill add my links over to that ticket as well since i am passing the variables to terraform via environment variables. |
I came here through google, I am having the same problem. I have a key I've generated for an application which has all sorts of fun chars like ( + ] and so on and terraform has been throwing this error. I'm not sure if the contents of the var are related to this problem but it sounds like something is choking along those lines as TF is fine with the rest of my vars. EDIT: Should probably mention I am using 0.12.5 EDIT EDIT: This seems to be fixed by using |
I do not know if it is related to this bug, but anyway, this is my case: I have a variable defined as:
On my
and I am trying to use those values in my
on that scenario when I run
Terraform version: 0.12.5 Any clue if is it related or should I convert it to a ticket? |
We have the same issue with TF 0.12.6. Terraform ignores TF_VAR_whatever |
I'm seeing this, too.
|
After I add the aws_region variable, and set it to
|
I started encountering this issue after the recent updates to the free tier on Terraform Cloud (post HashiConf 2019). When using the
This was configuration code that had been working just fine prior to HashiConf 2019 (when all the changes to Terraform Cloud went GA), so after scratching my head I tried running an apply with the
I then changed my So after following the suggestion to
For some reason it sees my workspace as
So there seem to be some pretty big changes to the UPDATE Just keep in mind -- it seems if you’re using the new TF Cloud free tier and |
Just to chime in here, I ran into this error in Azure DevOps with ver. 0.12.8 when I was defining vars via:
For the second case, it seems the docs (https://www.terraform.io/docs/commands/plan.html) might need a hand? I was able to get around this by defining them like so: Specific to Azure DevOps, if anyone's in the same boat: One of the issues I had in troubleshooting was color mode (which I love!) but which was messing a bit with the output:
Whereas once I started planning with
|
You, sir, just saved my day. Thanks (a whole lot of these) from Italy. Should you ever come near Genoa, ping me and you'll gain a beer. EDIT for those with AWS CLI installed and configured: TFC workspaces' "remote plan execution" prevented the automatic scan of ~/.aws/config file that Terraform used to perform. |
Hi all! Reviewing the discussion here, it seems like there are several different issues all being reported together here. We're treating this issue as being specifically about the error message covered in the original comment:
If you are having other issues, please check if there's another issue for them already and if not please do feel free to open a new issue. For Terraform Cloud issues in particular it's important to separate them because they will likely be fixed in a different codebase (for Terraform Cloud) and so cannot be resolved along with the bug this issue is about, which is a Terraform CLI bug. Thanks! |
From my initial investigation here, I've learned that this error arises when input is disabled with In that case, the processing doesn't happen in quite the right order right now: the initial validation of the variables happens prior to the input step, and it tolerates missing variables on the assumption that the input step will populate them. But when input is then disabled there's no final step to actually check that everything is correct, so it falls through into the internal safety check that is producing the "has not been assigned a value" error message. Fixing this will require reordering these steps slightly so that the validation step can happen after the (optional) input step to make sure that everything has been populated one way or another before we pass the final set of variables in to the core part of Terraform. |
New workspaces in Terraform Cloud defaulting to an Execution Mode of Remote cost several hours. Thanks for the pointer @jrsdav |
Hi all! Terraform 0.12.11 will contain a fix to properly catch this problem (required variables not set but
In the course of fixing that, we've also refactored how the variable value collection is implemented in the hope of allowing it to handle the presence and absence of required variables consistently in a single place, so that we shouldn't see differences anymore between variables set interactively vs. non-interactively, via the environment vs. CLI, etc. If (after 0.12.11 is released and you've upgraded to it) you find that you are seeing the above message in cases where the variable in question is set, please do open a new issue for that and we can investigate what else is going on. There were a lot of different various problems reported in the comments above, so splitting each of them into a separate issue is a better way to give us room to discuss and debug each one separately and figure out what's going on, particularly since some of them seem to be Terraform Cloud issues rather than Terraform CLI issues and would thus require solutions in a different place. |
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. |
Hi, I'm trying to run atlantis on AWS Fragate through https://github.com/terraform-aws-modules/terraform-aws-atlantis.
I've set up everything but am getting a wierd error. I am fairly sure that the variables are set through environment.
Crash Output
The text was updated successfully, but these errors were encountered: