Stuck on defining a Genesys Cloud queue with skills in Terraform using the CX as Code provider.
Error: Invalid attribute ‘skills’
My genesyscloud_routing_queue resource rejects the skills block. Is the syntax genesyscloud_routing_queue_skill or nested?
hcl
resource "genesyscloud_routing_queue" "main" {
name = "Audit Queue"
skills {
id = "123"
}
}
Check your provider version because the skills block was deprecated in favor of the separate genesyscloud_routing_queue_skill resource. The documentation states: “Queue skills are managed independently to allow for better lifecycle control and avoid circular dependencies.”
{
"resource": "genesyscloud_routing_queue_skill",
"arguments": {
"queue_id": "${genesyscloud_routing_queue.main.id}",
"skill_id": "123"
}
}
This issue stems from the provider schema update. The nested block is invalid in current versions.
Use the standalone resource.
resource "genesyscloud_routing_queue_skill" "main" {
queue_id = genesyscloud_routing_queue.main.id
skill_id = "123"
}
Verify the queue_id output before applying to avoid drift errors.
How I usually solve this is by enforcing the separate resource pattern to prevent state locking issues during bulk imports.
- Provider version compatibility
- Resource dependency chains
- Terraform state drift
How I usually solve this is by enforcing the separate resource pattern to prevent state locking issues during bulk imports. The standalone genesyscloud_routing_queue_skill resource is the correct approach for current provider versions.
When syncing queue configurations from external systems like Microsoft Teams bots, managing skills independently avoids the circular dependency errors common with nested blocks. Ensure your provider version is updated, as older versions might still accept the deprecated syntax but fail on drift detection. Here is the standard implementation I use in my pipelines:
resource "genesyscloud_routing_queue" "main" {
name = "Audit Queue"
}
resource "genesyscloud_routing_queue_skill" "main" {
queue_id = genesyscloud_routing_queue.main.id
skill_id = "123"
}
This separation aligns with the Genesys Cloud API structure where skills are linked entities rather than intrinsic properties of the queue definition itself.