We are refactoring our CX-as-Code modules to reduce dependency on hardcoded IDs. The goal is to reference existing Genesys Cloud routing queues by name using Terraform data sources. This should make the infrastructure state more portable across our dev and staging environments in the EU-West region.
The current setup involves a data source block that queries the genesyscloud_routing_queue resource. We expect this to return the ID of a queue named ‘Sales_Support_EU’. However, the plan phase fails immediately. The error message indicates that no matching resources were found, even though the queue exists and is active in the Genesys Cloud admin console.
Here is the relevant Terraform configuration snippet:
data "genesyscloud_routing_queue" "sales_eu" {
name = "Sales_Support_EU"
}
resource "genesyscloud_routing_user_settings" "agent_settings" {
user_id = var.agent_id
routing_queue {
queue_id = data.genesyscloud_routing_queue.sales_eu.id
enabled = true
}
}
The execution log shows a 404 response from the /api/v2/routing/queues endpoint when the provider attempts the lookup. I have verified the OAuth token has the routing:queue:view permission. The queue name matches exactly, including case sensitivity.
I tried adding a depends_on clause to ensure the queue is created before the lookup, but that did not resolve the issue. Is there a specific filter or attribute required in the data source configuration to force a successful match by name? The provider documentation suggests this should work out of the box.
We are using provider version 1.45.0. The state file shows the queue resource is managed, but the data source lookup seems to be hitting a different API path or applying unexpected filters. Any insights into why the name-based lookup is failing would be appreciated. We need this working before the next sprint cycle.