Hey everyone,
I’m trying to set up a Terraform configuration that references an existing Genesys Cloud user by name so I can assign them to a new queue. Seems straightforward enough, but the data source lookup keeps failing.
Here’s what I’ve got:
data "genesyscloud_routing_skill_group" "support_team" {
name = "Support Tier 1"
}
data "genesyscloud_user" "agent_jones" {
name = "John Jones"
}
resource "genesyscloud_routing_queue" "main_queue" {
name = "Main Support Queue"
skill_group_ids = [data.genesyscloud_routing_skill_group.support_team.id]
member {
user_id = data.genesyscloud_user.agent_jones.id
}
}
When I run terraform plan, it bombs out with this error:
Error: No matching user found for name "John Jones"
I’ve double-checked the spelling in the Genesys Cloud UI. The user definitely exists. I even tried using the email address in the data source block, but that didn’t work either. The documentation says the name attribute is unique, but maybe I’m missing something about how the lookup works.
Is there a way to force Terraform to search by email instead? Or do I need to pull the user ID from somewhere else first? I don’t want to hardcode the ID because it changes between our dev and prod environments.
Also, I noticed the data source doesn’t seem to support filtering by division. Is that a limitation of the provider? I’ve got multiple divisions with the same agent names, and I’m worried this could cause issues later.
Any ideas on how to make this lookup more reliable? I’ve been stuck on this for a couple of hours now.