Terraform data source lookup by name failing with 404

Hey folks,

Trying to reference an existing routing queue in my Terraform config without hardcoding the ID. I’m using a data source like this:

data "genesyscloud_routing_queue" "my_queue" {
 name = "Sales Support"
}

But the plan fails with a 404 Not Found. The queue definitely exists in the org. Is there a specific permission required for the service account to read routing queues via Terraform? Or is the name matching case-sensitive?

The 404 usually isn’t a permission issue if the service account can see the queue in the UI. It’s more likely a name mismatch or a state drift problem. The Terraform provider does an exact match on the name field. If there are trailing spaces in Genesys Cloud, the lookup fails.

Try using the genesyscloud_routing_queue_search data source instead. It’s more forgiving and returns a list, which you can then filter.

data "genesyscloud_routing_queue_search" "my_queue" {
 query = "Sales Support"
}

locals {
 queue_id = data.genesyscloud_routing_queue_search.my_queue.queues[0].id
}

Then reference local.queue_id in your resources. This avoids the strict 404 on the direct data source. Also check your service account’s scope. It needs routing:queue:view at minimum. If that’s missing, the API returns 404 even if the queue exists.