Hey folks,
I’m trying to bring an existing queue into our Terraform state. The queue is already live in production, so I can’t just destroy and recreate it.
I’ve got the resource block defined like this:
resource "genesyscloud_routing_queue" "main_support" {
name = "Main Support"
description = "General support queue"
enabled = true
}
When I run the import command, it bombs out immediately.
terraform import genesyscloud_routing_queue.main_support <queue-id-from-api>
The error message is pretty vague:
Error importing resource: Error importing resource: Post "https://api.mypurecloud.com/api/v2/routing/queues": 401 Unauthorized
Wait, that’s weird. My GENESYS_CLOUD_CLIENT_ID and CLIENT_SECRET are set in my .env file. I can hit the API directly with curl using those same creds and get a valid token. I even tried adding the genesyscloud provider block with explicit credentials, but it’s still failing on the import step.
I thought maybe it’s a scope issue? The app I’m using has routing:queue:read and routing:queue:write. Is import requiring something else? Or am I doing the import syntax wrong for this specific resource type?
I’ve checked the provider docs, but they just say “use the resource id”. What exactly is the ID? The UUID from the URL?
Any ideas on why it’s throwing a 401 during import when normal apply works fine?