Genesys Cloud Terraform Provider: Queue skills configuration failing with 400 Bad Request

I’m trying to define a Genesys Cloud queue with specific skills using the CX as Code Terraform provider (genesyscloud). The documentation suggests using the genesyscloud_routing_queue resource with a skill block, but I’m hitting a wall.

Here’s the relevant snippet from my main.tf:

resource "genesyscloud_routing_queue" "support_queue" {
 name = "Tier 1 Support"
 description = "General support queue"
 enabled = true
 
 skill {
 name = "billing"
 level = 100
 }
 
 skill {
 name = "technical"
 level = 80
 }
}

When I run terraform plan, it looks fine. But during terraform apply, it throws a 400 Bad Request. The error message is:

Error: POST /api/v2/routing/queues: 400 Bad Request
 Response: {"errors":[{"code":"bad_request","message":"Invalid skill configuration"}]}

I’ve verified that the skills “billing” and “technical” exist in the Genesys Cloud instance and are in the same division. I’ve also tried referencing them by ID instead of name, using a genesyscloud_routing_skill data source to fetch the ID first, like this:

data "genesyscloud_routing_skill" "billing_skill" {
 name = "billing"
}

resource "genesyscloud_routing_queue" "support_queue" {
 # ... other config ...
 skill {
 id = data.genesyscloud_routing_skill.billing_skill.id
 level = 100
 }
}

Same error. I’m using provider version 1.50.0. Is there a specific format required for the skill block that isn’t obvious from the docs? Or is this a known issue with the provider where it doesn’t handle skill assignments correctly on queue creation?

I can create the queue manually in the UI and add skills there without issue, so it’s not a permissions problem. Just the Terraform provider acting up. Anyone else run into this?

That 400 is likely the routingSkills block structure. The provider expects a nested map, not a flat list. Try this:

routing_skills {
 skills {
 "skill_id_1" { name = "Support" }
 }
}

Check the logs for the exact validation error.

Are you using the latest version of the vider? The schema for routing_skills changed a bit in the last few releases and old examples are still floating around.

The suggestion above is close, but the syntax inside the skills block is usually a map of skill IDs to objects, not just names. You also need to make sure those skill IDs actually exist in your org before applying. If you reference a skill that hasn’t been created yet, the API throws a 400.

Try this structure:

resource "genesyscloud_routing_queue" "support_queue" {
 name = "Tier 1 Support"
 description = "General support queue"

 routing_skills {
 skills {
 "your-skill-id-1" {
 name = "Support"
 }
 "your-skill-id-2" {
 name = "Tier1"
 }
 }
 }
}

Also, check your state file. If you’ve been manually tweaking the queue in the admin portal while running terraform, you’ll get drift errors that look like validation failures. Run a terraform plan first to see if it’s trying to delete and recreate the queue instead of just updating it. That’s a painful gotcha.