Closed imranismail closed 5 years ago
I'm running into this same issue and earlier opened a ticket with Hashicorp support about it.
This doesn't just happen on a CLI-initialized terraform plan
but also on a VCS-triggered plan. I'm not sure, but I think Terraform does generate a valid plan, then does something else that breaks? For me, it showed what changes would happen, correct variables and all, then errors out saying it couldn't find the input variables.
Edit: I just tried 0.12.10 and it works as-expected. So regression, I guess.
We ran into this too, but there's a cure! You have to set vars for every variable you use. It's a bit annoying that in what's technically a patch release there was a breaking change, but oh well. From an interface perspective this makes a lot of sense. If like us, you set variables in the backend that aren't declared in the repo, you just have to give them defaults.
variable "some_var" {
default = "sane default"
}
# for vars that don't have sane defaults
variable "who_killed_the_muffin_man" {
default = null
}
Thanks for the reports! We're looking into this, and have a suspected source (https://github.com/hashicorp/terraform/pull/23040) but will update as we progress on our investigation. Thank you for noting a workaround, @WillBeebe!
Hi all! Thanks again for reporting this and sharing workarounds.
The fix for this regression is in the v0.12.12 release, which is now available for selection on Terraform Cloud.
Because this bug is an interaction between Terraform CLI and Terraform Cloud, it's unfortunately important to upgrade both your local CLI executable and the version selected on the remote workspace. v0.12.11 is not functional either as a remote operations client or within the Terraform Cloud remote execution environment.
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 terraform plan on a remote backend (terraform cloud) with 0.12.11 however it always says variable not set. I suspect this is related to https://github.com/hashicorp/terraform/issues/21659
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
Remote terraform plan should be run in the cloud where all variables are already set
Actual Behavior
Terraform plan reports missing variables
Steps to Reproduce
terraform init
with backend set to terraform cloudterraform plan
References
21659