Trying to grab an existing queue via data “genesyscloud_routing_queue” “main” { name = “Support” } but it comes back empty even though the queue definitely exists. The ID lookup works fine, so why does the name filter fail in the provider?
The provider doesn’t do fuzzy matching by default. If the queue name has a trailing space or different casing, it returns empty. Check the exact name in the UI.
Also, the name filter is case-sensitive. Try using description if the name is ambiguous, or better yet, stick to ID lookups for production code. Names change, IDs don’t.
If you really need name-based lookup, use the genesyscloud_routing_queue data source with name set exactly as it appears. But honestly, I prefer pulling the ID from a previous resource or a variable file. It’s less headache.
Here’s a safer pattern using the API directly in a pre-deploy script if Terraform keeps failing:
var client = PlatformClientFactory.BuildPlatformClient();
var queues = await client.RoutingApi.GetRoutingQueuesAsync(search: "Support", pageSize: 10);
Console.WriteLine(queues.Entities.First().Id);
Grab the ID once, hardcode it in your TF state or variable. Saves a lot of debugging time.