Map inside map declaration

Hi,

It’s possible to assign the value of a variable of type “map” to another variable of type “map”, directly displays the message:

Variables may not be used here.

variable "config1" {
  type = map
  default = {
    "key1" = "10"
    "key2" = "20"
  }
}

variable "server1" {
  type = map
  default = {
    "keyz" = "${var.config1["key1"]}"
  }
}

Thanks

I believe the problem is you’re trying to include a reference to one variable in the default value of another. I don’t think this is supported.