SIP Trunk Provisioning via GC CLI fails with 409 on existing domain

Why does the genesyscloud sip-trunk command returns a 409 Conflict when provisioning a new trunk against an existing SIP domain in our staging environment? We are automating infrastructure using Terraform 1.6 and the Genesys Cloud CLI v2.16.0. The Terraform state shows the trunk resource as tainted or not found, but the API call fails before any creation attempt completes.

The error payload indicates a duplicate resource ID conflict, yet no trunk with that name exists in the org. We suspect the CLI is caching a stale ID from a previous failed deployment or there is a race condition in the SIP domain registration API. The endpoint /api/v2/platform/sip/trunks returns 409 immediately upon POST request.

Here is the relevant Terraform snippet causing the issue:

resource "genesyscloud_sip_trunk" "main" {
 name = "prod-sip-trunk-01"
 description = "Main SIP Trunk"
 domain = "sip.example.com"
 
 sip_endpoints {
 address = "10.0.0.5"
 port = 5060
 protocol = "UDP"
 }
}

The environment is us-east-1. We have verified that no other trunks exist with the same domain name. The 409 error message specifically cites conflict with reason duplicate_domain_binding. This blocks our CI/CD pipeline for environment promotion.

  • Attempt 1: Manually deleted the SIP trunk and domain via the Genesys Cloud UI. Retried the CLI command. The 409 error persists, suggesting the CLI might be referencing an internal ID that is not being cleared.
  • Attempt 2: Added a depends_on meta-argument in Terraform to ensure the SIP domain resource is fully created before the trunk resource is provisioned. No change in behavior. The conflict still occurs at the API level.

We need to understand if this is a known CLI bug or a limitation in the SIP provisioning API. Any insights on clearing cached state or forcing a fresh ID generation would be appreciated.