Closed SpencerBrown closed 5 years ago
Hi @SpencerBrown
Sorry for the inconvenience here. That release is a few moths out of date; the latest alpha is v0.12.0-alpha4. The bare variable syntax should work with the latest alpha and with the current master as well.
@jbardin thanks for the response. As i mentioned I also see this error in master, unless I'm doing something wrong in the build. Even simpler repro:
variable "bar" {
default = "foobar"
}
output "foo" {
value = var.bar
}
Spencer-Brown:bug spencer$ terraform -v
Terraform v0.12.0-dev
Spencer-Brown:bug spencer$ terraform apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
foo = foobar
Spencer-Brown:bug spencer$ terraform get
Error loading configuration: Error parsing /Users/spencer/mongodb/tf-x509/bug/main.tf: At 11:11: Unknown token: 11:11 IDENT var.bar
Spencer-Brown:bug spencer$
Hi @SpencerBrown!
It does seem like something weird is going on here, since that error message looks like what we'd expect to see from the old config parser (0.11 and earlier) rather than new. Perhaps there's some remnant code still calling into the old parser somewhere.
I'm going to re-open this so we can investigate further and see what's going on before we do v0.12.0 final.
Sorry, that was my error parsing, terraform get
is the issue here.
Looks like get
is still calling the old config loader to list module sources.
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.
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
terraform get should not error because I have an HCL2 variable value without the "${}"
Actual Behavior
Error loading configuration: Error parsing /Users/spencer/mongodb/tf-x509/bug/main.tf: At 7:13: Unknown token: 7:13 IDENT var.bar
Steps to Reproduce
terraform init
terraform validate
terraform get
Additional Context
saw this error with alpha1, also tried with master branch of terraform, same error
References