Terraform for_each with YAML vars for queues breaking on spaces

Trying to spin up a bunch of queues from a YAML file using for_each. The YAML parses fine in HCL, but the provider barfs when a queue name has spaces. I’m using file("queues.yaml") and mapping it, but get a “queue name invalid” error during apply. Is there a clean way to handle this without writing a custom data source? Here’s the snippet:

terraform {
 required_providers {
 genesyscloud = {}
 }
}

variable "queues" {
 default = file("queues.yaml")
}

resource "genesyscloud_routing_queue" "q" {
 for_each = var.queues
 name = each.value.name
}

Docs state: “The genesyscloud_queue resource requires the name attribute to be a non-empty string.” Spaces aren’t the issue, it’s how you’re interpolating the YAML value into the HCL map. Check your for_each loop syntax.