Could someone explain the correct syntax to use for_each with a YAML variable file to provision multiple Genesys Cloud queues via the CX as Code provider. I am trying to map a list of queue names from a YAML file to genesyscloud_routing_queue resources, but the provider throws a parsing error when I attempt to iterate over the imported YAML map.
locals {
queues = yamldecode(file("queues.yaml"))
}
resource "genesyscloud_routing_queue" "this" {
for_each = local.queues
name = each.value.name
}
The error indicates that the provider expects a map of strings, but yamldecode returns a complex structure. How do I flatten this correctly?
Thanks for the help.