Just upgraded our CX as Code provider to v1.35.0 and ran into a wall with the genesyscloud_user resource. It seems the schema for the groups attribute changed, but the docs are vague on how to migrate existing state without destroying and recreating users.
Here is the config we have been using for months:
resource "genesyscloud_user" "support_agent" {
name = "Test Agent"
email = "test@example.com"
groups = [genesyscloud_group.support.id]
}
After the upgrade, terraform plan throws this error:
Error: "groups": this field cannot be set on its own, please set "group_ids" instead
I tried swapping groups for group_ids, but then Terraform wants to delete the user and create a new one, which breaks our audit trails and loses historical data.
Here is what I’ve tried:
- Used
terraform state replace-providerto reset the provider version (didn’t help). - Manually updated the state file to change the attribute key from
groupstogroup_ids(caused a validation error on apply). - Added
lifecycle { ignore_changes = [group_ids] }but it still flags a diff.
Is there a safe way to migrate the state for this resource without downtime? We have hundreds of users defined this way.