Does anyone know the correct syntax for mapping skill attributes to a queue definition within the genesyscloud_queue resource? I am attempting to define a queue with specific skill requirements using the CX as Code Terraform provider.
Background
I am building an Infrastructure as Code pipeline to manage Genesys Cloud resources. My goal is to create a queue that requires specific skills for routing. I am using the genesyscloud_queue resource and attempting to set the outbound_wrap_up_code and skill requirements via the routing_skills block.
Issue
When I apply the configuration below, the terraform plan succeeds, but terraform apply fails with a validation error regarding the routing_skills structure. The error message indicates that the skill_id field is expected to be a string, but the provider seems to interpret it as a map or object incorrectly.
resource "genesyscloud_queue" "sentiment_analysis_queue" {
name = "Sentiment Analysis Queue"
description = "Queue for high-priority sentiment cases"
enabled = true
split_skills = true
routing_skills {
skill_id = "12345678-1234-1234-1234-123456789012" # This is a valid skill ID from our org
priority = 1
level = 5
}
}
The error returned is:
Error: expected routing_skills.skill_id to be a string, got map[string]interface{}
Troubleshooting
I have verified that the skill_id is a valid UUID string. I have also checked the provider documentation for version 1.45.0. The documentation shows the routing_skills block should contain skill_id, priority, and level.
I suspect the issue might be related to how the provider handles the list of skills versus a single skill object. I tried wrapping it in a list syntax routing_skills = [{...}] but that resulted in a different parsing error. I am running this in a local environment with the provider initialized via terraform init. The timezone is Europe/Stockholm, but I do not believe this affects the schema validation.
Is there a specific way to define the routing_skills block that I am missing? Or is this a known bug in the current provider version?