Terraform for_each with YAML queue definitions fails on complex objects

Can anyone clarify the correct syntax for using for_each with nested YAML objects for CXone queues?

Background

I am mapping a YAML file containing queue configurations to Terraform resources using file("queues.yaml").

Issue

The for_each loop throws an error: “Inappropriate value for variable “queues”: element “name”: string required.” when passing the full object map.

Troubleshooting

I tried flattening the map, but I lose the association between the queue name and its specific settings. How should I structure the variable to pass individual queue objects to the genesyscloud_queue resource?