Just noticed that the genesyscloud_routing_integration resource is failing during the promotion stage from Dev to Test. The configuration is identical across environments, but the web chat integration keeps drifting.
The issue seems to be related to the session storage configuration. When applying the HCL, the API returns a 409 Conflict. The error indicates that the session_id generation strategy is locked by an existing runtime state that Terraform cannot overwrite via the standard API endpoints.
Error: Conflict when updating routing integration: 409 Conflict
Body: {"errors":[{"code":"conflict","message":"Session state configuration cannot be modified while active sessions exist. Please drain sessions or use force_destroy."}]}
Here is the relevant snippet from the module:
resource "genesyscloud_routing_integration" "webchat" {
enabled = true
integration_type = "WEBCHAT"
settings = {
"sessionTimeout" = "300000"
"storageType" = "MEMORY"
}
}
The storageType is set to MEMORY to avoid database dependencies, but the Genesys Cloud platform seems to retain session metadata even after the integration is disabled in the UI. This causes the Terraform state to become out of sync with the actual platform configuration.
Running terraform refresh does not resolve the drift. The state file shows the configuration as expected, but the API refuses to apply changes because it detects ‘stale’ sessions.
Environment details:
- Provider:
genesyscloud/genesyscloudv1.12.0 - Region:
ap-southeast-2 - CLI Version:
v2.14.5 - Terraform Version:
v1.6.4
Is there a specific API call or CLI command to forcibly clear the web chat session store before running the apply? The standard documentation mentions draining sessions, but there is no clear programmatic hook for this in the provider.
We need a reliable way to handle this in our GitHub Actions pipeline without manual intervention. Any workarounds or hidden flags in the provider configuration?