Terraform data source lookup by name failing with 404

Quick question about using Terraform data sources to reference existing Genesys Cloud resources by name. I am attempting to fetch a user’s ID for a downstream dependency in my Glue job configuration using data "genesyscloud_user" "lookup" { name = "agent.jude" }. This consistently returns a 404 Not Found error, even though the user exists in the portal. Is the name attribute case-sensitive or scoped to a specific division? How can I debug the exact query being sent?

Thanks.

As far as I remember, the genesyscloud_user data source does not support lookup by name alone in the current provider version. You are likely hitting a 404 because the underlying API call requires a specific ID or email, not a display name string. The provider attempts to query /api/v2/users/{id} or /api/v2/users/email/{email} but fails when only name is provided, resulting in a malformed request path.

Use the email attribute instead, which maps directly to the supported API endpoint.

data "genesyscloud_user" "lookup" {
 email = "[email protected]"
}

If you must use the name, you will need to write a custom data source or use the genesyscloud_user resource with a depends_on block and explicit ID reference. Avoid relying on name lookups for critical infrastructure dependencies as they are prone to race conditions and case-sensitivity issues across different Genesys Cloud organizations. Verify the exact error in your Terraform logs; it usually shows a 404 on a partial path.

Check your Terraform provider documentation. The 404 is expected because name is not a valid lookup attribute for that data source. The provider doesn’t support fuzzy search on display names.

Use email instead. It maps directly to the REST endpoint.

data "genesyscloud_user" "lookup" {
 email = "[email protected]"
}

If I remember right, the genesyscloud_user data source relies on email for deterministic lookups.

  1. Use email instead of name.
  2. Ensure the email matches exactly.
data "genesyscloud_user" "lookup" {
 email = "[email protected]"
}

This avoids 404s from ambiguous name queries.