Terraform import failing on Genesys Cloud user resource with 400 Bad Request

  • Terraform 1.6.0
  • Genesys Cloud Provider 1.15.0
  • SvelteKit internal dashboard
  • Environment: Production US-East

What is the correct way to import an existing Genesys Cloud user into Terraform state without triggering schema validation errors? I am trying to codify my internal status widget’s backend users using CX as Code. The user exists in GC, and I have the ID from the UI.

I ran:

terraform import module.gc_users.genesis_cloud_user.main "user-id-123"

Terraform hangs for a moment, then fails with:

Error: 400 Bad Request
Content: {"errors":[{"code":"bad_request","message":"Validation failed for fields: email"}]}

The user has a valid email in GC. My config looks like this:

resource "genesis_cloud_user" "main" {
 email = "[email protected]"
 name = "Dev User"
 division_id = var.default_division
}

Is the provider not fetching the full resource graph? Do I need to manually set the division_id to match exactly? I checked the API docs for /api/v2/users/{userId} but the import logic seems to strip required fields. This is blocking my migration to infrastructure as code. Help.

If I remember correctly…

The 400 error usually stems from missing required fields in the initial state import. You must provide the email and first name in your import command arguments.

terraform import genesys_cloud_user.myuser <user_id>:<email>:<first_name>

Check the provider docs for the exact argument order.