unknown token IDENT list error for IP address variable

learner picture learner · Oct 11, 2018 · Viewed 12.1k times · Source

I have defined variable in my .tfvars variable as

variables.tfvars

address_space = ["10.197.0.0/16"]

build-windows.tf

variable "address_space" {
  type = list
}

In build-windows.tf file I get the error as Unknow token ident list?

Not sure what I am doing wrong here, I even do not understand why terraform wants me to use the list instead of a string. When I use string I get an error in terraform plan stating that I have to use list.

Not going anywhere.

Please assist

Answer

Benjamin Manns picture Benjamin Manns · Oct 11, 2018

The type parameter is a string - try passing "list" into it.

variable "address_space" {
  type = "list"
}