I've configured the following variable in module/variables.tf
variable "instance_name" {
type = string
default = "instance-1"
description = "Name of the instance."
}
I refer to the variable in the same module module/main.tf as below
resource "google_compute_instance" "cloud_instance" {
name = var.instance_name
}
However, when I run terraform init, I get the following error-
Error: Error parsing /module/main.tf: At 15:12: Unknown token: 15:12 IDENT var.instance_name
Any idea why this is happening?
name = "${var.instance_name}"
– ydaetskcoR