Getting a Reference to undeclared resource error when trying to map queue names from a YAML file using for_each. I’ve loaded the file with yamldecode but terraform plan can’t find the attributes in the loop. Here’s the snippet:
locals {
queues = yamldecode(file("queues.yaml"))
}
resource "genesyscloud_routing_queue" "test" {
for_each = local.queues
name = each.value.name
}
The YAML structure is just a list of objects. It works fine with a simple map, but this nested list format breaks the attribute reference.