unknown token IDENT list error for IP address variable

13,404

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

variable "address_space" {
  type = "list"
}
Share:
13,404

Related videos on Youtube

learner
Author by

learner

Life is a constant learning journey. I am always hungry to learn new things. Never stop learning.

Updated on June 04, 2022

Comments

  • learner
    learner almost 2 years

    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

  • learner
    learner over 5 years
    Super! Worked :)
  • Daniel Agans
    Daniel Agans about 5 years
    well that's def not whats in their docs, but it sure did work
  • StockB
    StockB almost 5 years
    As of v0.12, a variable type may be defined as an (unquoted) keyword: terraform.io/docs/configuration/variables.html