I’m trying to use for_each to create queues from a YAML file in my Terraform config. The local variable parses fine but the resource block throws an error about invalid keys. Here is the snippet:
terraform {
required_providers {
genesyscloud = {
source = "mycompany/genesyscloud"
}
}
}
locals {
queues = yamldecode(file("queues.yaml"))
}
resource "genesyscloud_routing_queue" "this" {
for_each = local.queues
name = each.value.name
}
The error says the key must be a string but I’m getting a tuple. How do I fix this mapping?