Terraform conflict on Agent Script versioning in AU-East

Stuck on a 409 Conflict error when updating agent scripts via the gc-provider. The pipeline fails during the apply phase when trying to update the genesyscloud_script resource. The API rejects the update because the script version in the state file does not match the current version in Genesys Cloud. This happens after a manual edit in the UI by the QA team, which breaks the state consistency.

The error log shows:

Error: Error updating Script: 409 Conflict
 on scripts.tf line 12, in resource "genesyscloud_script" "onboarding":
 12: resource "genesyscloud_script" "onboarding" {

The script has multiple versions. The Terraform state tracks version 2, but the platform now holds version 3. The provider does not seem to have a force_update or ignore_version argument for scripts, unlike some other resources.

Environment details:

  • Genesys Cloud: AU-East
  • Terraform: 1.7.0
  • gc-provider: v2.0.9
  • Script Type: Agent Script with multiple steps

Is there a recommended way to handle version drift for scripts? Should I use the CLI to export the latest version and import it back into state? Or is there a specific API call to bump the version programmatically before the Terraform apply? Need a clean solution to prevent manual edits from breaking the CI/CD pipeline.

To fix this easily, this is… to import the current state rather than forcing an update. Run terraform import genesyscloud_script.my_script <script_id> to sync the state file with the UI version. This resolves the version mismatch without overwriting the QA changes. Always verify the metadata integrity after importing to ensure no data loss for audit trails.