Trying to spin up multiple queues from a YAML file using the Genesys Cloud Terraform provider. The goal is to avoid hardcoding genesyscloud_routing_queue resources. I’ve got a local_file data source pulling in queues.yaml, but the for_each loop isn’t unpacking the map correctly. It keeps throwing a “No value for required field” error on the name attribute, even though the YAML clearly has it. Here’s the snippet:
data "local_file" "queue_config" {
filename = "${path.module}/queues.yaml"
}
resource "genesyscloud_routing_queue" "queue" {
for_each = yamldecode(data.local_file.queue_config.content).queues
name = each.value.name
description = each.value.desc
}
The YAML looks standard, just a list of objects. Debugging with terraform console shows the data source is returning a string, not a map. Is there a specific way to parse the YAML content before passing it to for_each? The docs are sparse on dynamic resource creation from external files. Frustrating that I have to write a script to generate HCL just to get around this.