I have the following map of subnet ids as a variable to be used in a Terraform aws_autoscaling_group resource:
subnet_ids = {
"us-east-1" = "subnet-123abc,subnet-456def,subnet-789ghi"
"us-west-2" = "subnet-1a2b3c,subnet-4c5d6e,subnet-7g8h9i"
}
and variable as
variable subnet_ids {
description = "subnet ids"
type = "map"
}
but this not working as Terraform is complaining that it needs a list but is seeing a map.
This worked by just setting up one region temporarily:
subnet_ids = ["subnet-123abc", "subnet-456def", "subnet-789ghi"]
and variable as:
variable subnet_ids {
description = "subnet ids"
type = "list"
}
and passed as vpc_zone_identifier = "${var.subnet_ids}"
So pretty much want a way to be able to use the map and be able to pass in lists based on the region picked
Thanks