in main.tf →
private_subnets = lookup(var.private_subnet_map, terraform.workspace)
in variables.tf →
variable "private_subnet_map" {
type = map(list)
default = {
"workspace1" = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"],
"workspace2" = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"],
"workspace3" = ["10.1.4.0/24", "10.1.5.0/24", "10.1.6.0/24"],
}
}
The above syntax doesn’t work. What is the right way to make it work ?