Reputation: 27
I want to use environment variable in Terraform but my TF code is not recognised TF_VAR. I set as environment variable export TF_VAR_test="some value"
and tried to use in my TF code tempval = var.test
.
Using terraform v1.0.2
What I missed here? please advise me. thanks.
Upvotes: 2
Views: 1488
Reputation: 1411
Before using a variable, one must declare the variable in a variable block.
For example...
variable "test" {
type = string
}
Upvotes: 4