Running into a stubborn 409 Conflict error when trying to update a genesyscloud_auth_division resource. We’re managing hybrid platform divisions and trying to standardize the description across environments.
Here’s the resource block:
resource "genesyscloud_auth_division" "support_div" {
name = "Support Division"
description = "Updated description via Terraform"
lifecycle {
ignore_changes = [description]
}
}
Even with ignore_changes on the description, terraform plan shows a change, and terraform apply crashes with:
Error: PUT https://api.mypurecloud.com/api/v2/organizations/divisions/support_div: 409 Conflict
I’ve tried:
- Removing the state entry and re-importing.
- Hardcoding the ID in the resource.
- Using
depends_on to ensure the organization is ready.
The API docs say 409 means the division already exists, but Terraform is trying to PUT the whole object. Is there a way to force a PATCH or tell the vider to skip the update if the name matches? Or is this a vider bug with the auth division endpoint?
ignore_changes won’t stop the API from rejecting a duplicate name if you’re swapping it. The 409 is likely a uniqueness constraint violation, not a drift issue. Try fetching the division ID first and updating only the description via the REST API directly to bypass the vider’s implicit create-then-update logic.
resource "genesyscloud_auth_division" "support_div" {
name = "Support Division"
# remove lifecycle block to test raw API behavior
}
is spot on about the uniqueness constraint. The 409 isn’t coming from Terraform complaining about drift. It’s the Genesys Cloud API rejecting a create attempt because a division with that name already exists in the tenant. The vider tries to create first, hits the duplicate, and bails.
If you want to keep this in Terraform and avoid the manual API dance, you need to stop the vider from trying to create it again. You can do this by importing the existing resource into your state file. That way, Terraform knows it’s an update, not a create.
Run this in your terminal where your main.tf lives:
terraform import genesyscloud_auth_division.support_div <division-id>
You’ll need to grab the division ID from the Genesys Cloud admin UI or via the API (GET /api/v2/auth/divisions). Once the import is done, remove the ignore_changes block if you actually want Terraform to manage the description. If you leave ignore_changes = [description], Terraform will never touch the description field, which defeats the purpose of your update.
If you’re stuck on the name collision because you’re moving between environments, make sure the names are unique per environment or use a variable to suffix the name. The API won’t care about your local state if the global namespace is clashing.