Terraform import fails on Genesys Cloud user resource with 'No resource matches'

terraform import genesyscloud_user.my_user 12345678-abcd-efgh-ijkl-123456789012

Error: No resource matches the address “genesyscloud_user.my_user” in the configuration. Try adding a resource block to the configuration.

I’m trying to move our existing Genesys Cloud org into state so we can manage it via CX as Code, but the import command keeps failing on user resources. I’ve got the user ID from the API response when I hit /api/v2/users/me, and I’m passing that exact string to the terraform import command. The resource block is defined in my main.tf with the correct ID placeholder, but Terraform claims it can’t match it.

I’ve verified the ID is correct by making a direct GET request to /api/v2/users/{id} and getting a 200 OK with the user details. I’ve also tried running terraform plan before the import, which shows no changes, so the config seems valid. I’m using the latest version of the Genesys Cloud Terraform provider (v1.65.0) and Terraform v1.5.7. I’ve cleared the cache, run terraform init again, and even tried importing via the import block syntax in the config file instead of the CLI command, but the result is identical.

The user is part of a large org with complex rules, so I’m wondering if there’s a dependency issue or if the provider has a known bug with user imports. I’ve checked the provider docs and the GitHub issues, but nothing matches this exact error. I’m frustrated because I can import queues and skills without issue, but users are failing every single time. I’m running this from a clean directory with no other state files. I’ve attached the relevant snippet from my main.tf below. Any ideas why the import command can’t find the resource when the ID is clearly valid?

You’re hitting this because the resource block isn’t actually defined in your .tf file yet. Terraform needs to see the schema before it can map an ID to it.

Add this to your config first:

resource "genesyscloud_user" "my_user" {
 name = "Existing User"
 email = "user@example.com"
 division_id = var.default_division_id # or whatever your division is
 # other required fields...
}

Run terraform plan to verify it picks up the block, then try the import again:

terraform import genesyscloud_user.my_user 12345678-abcd-efgh-ijkl-123456789012

Common trap here is missing the division_id. If the user isn’t in the default division, the provider might struggle to resolve the full resource path during import. Make sure you’re pulling the correct division ID from /api/v2/organizations if you’re using a custom one. Also check that your provider block has the right region set, otherwise the API calls go to the wrong endpoint and fail silently.