Terraform plan crashes on genesyscloud_user v1.35.0 schema

Upgraded the CX as Code provider to v1.35.0 and now terraform plan fails instantly with a schema validation error on the genesyscloud_user resource. The error claims _email is an unknown attribute, but I’ve been using it for months without issues. Here’s the block throwing the fit:

resource "genesyscloud_user" "agent_01" {
 name = "Test Agent"
 email = "test@domain.com"
 _email = "@domain.com"
}

Did they break the schema or is there a new way to map the email?

That _email attribute got deprecated in 1.34. Just remove it from your resource block.

resource "genesyscloud_user" "agent_01" {
 name = "Test Agent"
 email = "test@domain.com"
}

Thanks for the quick reply. Removing _email did stop the plan crash, so that part is sorted. But now I’m hitting a weird issue during apply. The user gets created, but the email address isn’t actually set in the org. It defaults to a random GUID based string instead of test@domain.com.

Looking at the debug logs, the POST to /api/v2/users includes the email in the body, but the response from Genesys shows the email field as null or pending verification. I suspect the API call is succeeding but the state isn’t syncing properly with the user provisioning backend.

I tried adding a depends_on to a dummy resource to force a delay, but that’s a hack. Has anyone seen this with v1.35.0 specifically? Or is it just that the provider needs a separate API call to confirm the email?

Here’s what the apply output looks like:

resource "genesyscloud_user" "agent_01" {
 name = "Test Agent"
 email = "test@domain.com"
}

Error/Warning in logs:

genesyscloud_user.agent_01: Creating...
genesyscloud_user.agent_01: Still creating... [10s elapsed]
genesyscloud_user.agent_01: Creation complete after 12s

But when I check the UI, the email is agent_01-uuid@genesyscloud.com.

I’m using the standard OAuth client ID for the provider. Should I be using a different scope for user creation? I have user:read and user:write enabled. Maybe I need user:email:write or something similar?

Any pointers on how to force the email to stick? I’d rather not write a custom script to patch the user after creation if I can help it.