Genesys Cloud queue skills in Terraform

Is it possible to define a Genesys Cloud queue with skills in Terraform using the CX as Code provider?

resource “genesyscloud_routing_queue” “main” {
name = “Support”
skill_ids = [“skill-uuid”]

missing explicit skill resource or mapping

}

Getting error on apply: Error creating routing queue: 400 Bad Request. The API expects a specific structure for skills within the queue config but the terraform provider docs are sparse on this. How do I correctly bind skills to a queue in the HCL definition?

This happens because the Terraform provider requiring a distinct mapping object rather than a raw list of UUIDs when assigning skills to a queue, which often trips up the initial resource creation if the skill itself isn’t already persisted and linked correctly in the state file. You need to wrap your skill references in the proper routing_queue_skill block or ensure the skill_ids array points to fully realized resources defined earlier in your module, as the API rejects partial or unresolved identifiers during the queue POST. Here is how I structure it in my middleware configs to avoid that 400:

resource "genesyscloud_routing_skill" "support_skill" {
 name = "Support"
 description = "General Support Skill"
}

resource "genesyscloud_routing_queue" "main" {
 name = "Support Queue"
 skill_ids = [genesyscloud_routing_skill.support_skill.id]
 # Ensure other required fields like member_flow are present
}

Always verify that the skill resource is applied first or use depends_on if the order is ambiguous, otherwise the queue creation fails before it even hits the Genesys Cloud API layer.