Trying to bring an existing Genesys Cloud user under Terraform management. The user already exists in the cloud environment and has some custom attributes assigned. Running terraform import with the resource ID works fine for the basic fields like name and email. It fails when it tries to match the custom_attributes block.
Here is the resource definition:
resource "genesyscloud_user" "existing_agent" {
email = "agent@example.com"
name = "John Doe"
custom_attributes = {
"department" = "Support"
"level" = "L2"
}
}
The import command:
terraform import genesyscloud_user.existing_agent 12345-67890
The plan output shows the custom_attributes are being destroyed and recreated. That’s not what I want. I just want the state to match reality. The API call GET /api/v2/users/12345-67890 returns the custom attributes in the response payload, but Terraform ignores them during the import phase.
Is there a specific way to handle nested attributes during import? Or do I need to script a pre-import step using the SDK to fetch and map these values? The docs don’t mention anything about custom attributes on import. Just seeing a diff where everything is marked for deletion and recreation. That feels wrong for a 9-year-old account. Need to keep the history intact.