-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Labels
Description
Terraform Version
Terraform v1.13.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/null v3.2.4Terraform Configuration Files
terraform {
required_version = ">= 1.13.5"
}
variable "works" {
type = string
}
variable "does-not-work" {
type = string
}
resource "null_resource" "dummy" {
provisioner "local-exec" {
command = "echo 'This works: ${var.works}, but this doesn't: ${var.does-not-work}"
}
}Debug Output
Expected Behavior
Terraform should have seen that the environment variable (TF_VAR_does__not__work) was set and used the value from this environment variable as value for var.does-not-work.
This would be the same behavior as with TF_TOKEN where hyphens in the hostname are also replaced by two underscores.
Actual Behavior
Terraform does not find the environment variable and terraform prompts for it / errors, because it hasn't been set.
Steps to Reproduce
terraform initexport TF_VAR_works="works"export TF_VAR_does__not__work="doesn't work"terraform apply
Additional Context
No response
References
Generative AI / LLM assisted development?
No response