Terraform: for_each with YAML variable file for Genesys queues

I’m trying to spin up multiple queues in our Genesys Cloud org using Terraform. I have a YAML file (queues.yaml) listing the queue names and descriptions. I want to use for_each to iterate over it. My current setup looks like:

resource "genesyscloud_routing_queue" "this" {
 for_each = yamldecode(file("queues.yaml"))
 name = each.value.name
}

But I’m hitting a TypeError: string indices must be integers error during plan. The YAML is just a list of maps. How do I structure the for_each to handle this correctly?