Error: 409 Conflict
Message: Division already exists
I am attempting to provision a new authentication division for a sandbox environment using the Genesys Cloud Terraform provider (version 1.12.0). The terraform apply command fails consistently with a 409 Conflict error, claiming the division already exists, despite this being a fresh state file and a unique division name.
Here is my configuration:
resource "genesyscloud_auth_division" "sandbox_div" {
name = "Sandbox-Dev-Alpha"
description = "Isolated division for sandbox testing"
}
The documentation states: “The API will return a 409 if a division with the same name already exists in the parent division.”
However, I have verified via the UI and the REST API (GET /api/v2/auth/divisions) that no division named “Sandbox-Dev-Alpha” exists. Furthermore, I have tried deleting any potential leftovers manually, but the error persists on every subsequent run.
Is there a caching issue with the provider, or does the 409 conflict check happen at the global scope rather than the parent division scope? I am using the standard genesyscloud provider block with valid OAuth credentials.
provider "genesyscloud" {
base_url = "https://api.mypurecloud.com"
}
The error log from the Terraform output is:
╷
│ Error: 409 Conflict
│
│ with genesyscloud_auth_division.sandbox_div,
│ on main.tf line 12, in resource "genesyscloud_auth_division" "sandbox_div":
│ 12: resource "genesyscloud_auth_division" "sandbox_div" {
│
│ Division already exists
╵
I expected a 201 Created or a successful update if it existed, but not a hard failure on a fresh run. How do I debug this specific 409 conflict in the context of the Terraform provider?