Terraform plan drift on genesyscloud_routing_queue state lock error

Running into a weird issue with our Terraform pipeline for Genesys Cloud. We are managing routing queues via the genesyscloud_routing_queue resource. The plan command shows drift on the name attribute, even though the API shows the name is correct. Worse, terraform refresh fails with a state lock error.

Here is the resource definition:

resource "genesyscloud_routing_queue" "support_queue" {
 name = "US Pacific Support"
 description = "Main support queue for Pacific timezone"
 enabled = true
}

The error output looks like this:

Error: Error acquiring the state lock
Lock Info:
 ID: abc-123-def
 Path: state.tfstate.lock.info
 Operation: OperationTypeRefresh
 Who: user@corp.com
 Version: 1.0.0
 Created: 2023-10-27T10:00:00.000Z
 Info: 

I have tried:

  • Running terraform force-unlock with the lock ID. It says the lock doesn’t exist or is stale.
  • Checking the remote backend (S3) for stale lock files. Nothing there.
  • Manually verifying the queue name via POST /api/v2/routing/queues/{id}. The name matches exactly.
  • Clearing the local state cache and pulling fresh.

The drift persists. The plan shows:

~ resource "genesyscloud_routing_queue" "support_queue" {
 ~ name = "US Pacific Support" -> "US Pacific Support"
}

This is confusing. The value hasn’t changed, but Terraform thinks it has. The state lock error prevents me from fixing the state file directly. Is this a known issue with the Genesys Cloud provider? Or is there a race condition with the API during refresh?

We are using Terraform 1.5.2 and the Genesys Cloud provider v1.0.100. The environment is us-east-1. Any ideas on how to break this loop?