Terraform data source lookup failing for existing Genesys Cloud user

Hey everyone,

I’m trying to get our WFM Terraform scripts to play nice with our existing users. The goal is simple. We have a bunch of agents already provisioned in Genesys Cloud. I want to reference their IDs in our new resource definitions without hardcoding them.

I’m using the genesyscloud_user data source to look up users by name. It feels like the right approach based on the docs. Here’s the snippet I’ve thrown together:

data "genesyscloud_user" "wfm_admin" {
 name = "John Doe"
}

resource "genesyscloud_routing_queue" "wfm_queue" {
 name = "WFM Adherence Queue"
 members {
 user_id = data.genesyscloud_user.wfm_admin.id
 }
}

When I run terraform plan, it throws an error. The provider says it can’t find the user.

Error: Unable to find user with name "John Doe"

The user definitely exists. I can see him in the admin portal. His name is spelled exactly “John Doe”. I’ve checked for trailing spaces. Nothing weird there.

Is the data source lookup case-sensitive? Or does it need the email address instead? I tried switching to email = "john.doe@example.com" but it gave the same error.

I’m not sure if I’m missing a required attribute or if the data source just doesn’t work the way I think it does. Any pointers on how to reliably fetch existing user IDs?

check your GENESYS_CLOUD_BASE_URL env var. the provider often hits the wrong org if it’s not explicitly set, causing those phantom 404s on valid IDs.