Quick question about messaging application provisioning conflicts during Terraform state migration. We are automating the deployment of a new Webchat channel configuration using genesyscloud_messaging_application. The environment is AU-1 BYOC. Provider version is 2.5.1. Terraform version is 1.6.0.
The issue occurs when promoting configuration from Dev to Staging. The resource exists in Staging but was not imported into the state file correctly during initial setup. When terraform apply runs, it attempts to create the resource again. The API returns a 409 Conflict error. The error message indicates that the messaging_application_id is already in use. However, the genesyscloud_messaging_application resource does not seem to support an import command via standard CLI flags in the same way user resources do, or at least the documentation is sparse on the exact syntax for BYOC endpoints.
We need a reliable way to handle existing resources without manual intervention in the pipeline. The current workaround involves manually deleting the resource in the UI, which breaks audit trails and is not acceptable for production deployments. We are looking for a programmatic solution to either force the import or handle the conflict gracefully within the HCL configuration.
- Attempted to use
terraform import genesyscloud_messaging_application.webchat <id>but received a 404 Not Found error. This suggests the ID format or the endpoint resolution for AU-1 BYOC is different from the standard cloud regions. - Tried adding
lifecycle { ignore_changes = [id] }to the resource block, but this does not prevent the 409 error during the creation phase if the resource already exists in the platform but not in the state.
Is there a specific flag or API call required to verify existence before creation for messaging apps on BYOC? Or is the import command syntax different for this resource type? Any examples of successful state imports for messaging applications on AU-1 would be helpful. We are trying to maintain a pure IaC workflow without manual UI steps.