Problem
We’ve got a bunch of existing routing strategies in our production org that were set up manually years ago. I’m trying to start using Terraform to manage some new flows, but I need to reference those old strategies by name so I can attach them to new queues.
I assumed I could just use the genesyscloud_routing_strategy data source, but I’m running into a weird issue. The data source seems to require a specific ID or something that I don’t have handy. I just want to look it up by the name “High Value Customer Routing”.
Code
Here is the snippet I threw together:
data "genesyscloud_routing_strategy" "high_value" {
name = "High Value Customer Routing"
}
resource "genesyscloud_routing_queue" "new_queue" {
name = "New Support Queue"
routing_strategy_id = data.genesyscloud_routing_strategy.high_value.id
}
Error
When I run terraform plan, it doesn’t fail immediately, but when I try to apply, or sometimes even during plan if the state is empty, I get this:
Error: data source genesyscloud_routing_strategy.high_value: no matching routing strategy found. Please check that the name is correct and exists in the organization.
The name is definitely correct. I checked in the UI. There is only one strategy with that exact name.
I tried adding match_case = false just in case, but that didn’t change anything. I also tried using the genesyscloud_routing_strategy resource block to see if it would import it, but that tries to create a new one which obviously fails because the name is taken.
Question
Is the genesyscloud_routing_strategy data source even supposed to support lookup by name? The docs are pretty sparse on this. If I can’t look it up by name, how am I supposed to get the ID for an existing resource without hardcoding it? That defeats the whole point of IaC.
Also, is there a way to force it to search? I feel like I’m missing a basic config flag here.