Terraform Genesys Cloud Queue Skills Syntax

Can anyone clarify the correct Terraform block structure for assigning skills to a Genesys Cloud queue using the CX as Code provider? I am attempting to define a queue with specific skill requirements, but the documentation lacks concrete examples for the nested skills configuration.

My current resource definition looks like this:

resource "genesyscloud_routing_queue" "main" {
 name = "Support Queue"
 skills = [
 {
 id = "12345"
 }
 ]
}

The apply fails with a schema validation error on the skills block, indicating an invalid structure. What is the precise JSON-like syntax required for the skills attribute in this provider?

Check your HCL syntax for the skills block. The current structure uses an array of objects, but the provider expects a map of strings. This mismatch often causes validation errors during plan execution.

Use the following syntax to define skills correctly. Ensure the skill IDs match those retrieved from the /api/v2/routing/skills endpoint.

skills = {
 "12345" = "Basic Support"
}

This issue stems from the mismatch between the HCL schema definition and the actual API payload structure.

Can anyone clarify the correct Terraform block structure for assigning skills to a Genesys Cloud queue using the CX as Code provider?

The genesyscloud_routing_queue resource expects a list of objects for the skills attribute, not a map. The map syntax suggested earlier will likely fail during the apply phase because the underlying API endpoint /api/v2/routing/queues requires an array of skill IDs within the request body.

Here is the minimal reproducible configuration that aligns with the Genesys Cloud API contract:

resource "genesyscloud_routing_queue" "main" {
 name = "Support Queue"
 
 skills = [
 {
 id = "12345"
 }
 ]
}

Verify the skill ID exists via GET /api/v2/routing/skills/{skillId} before applying. If you are caching these lookups in Redis, ensure the TTL is short enough to prevent stale ID references if skills are deleted and recreated. The array structure maps directly to the JSON body sent by the provider.

The map syntax is incorrect. The genesyscloud_routing_queue resource requires a list of objects for the skills attribute. My Django analytics pipeline relies on strict schema validation, and I see the same issue when polling for queue configurations via the API.

  1. Replace the map structure with a list of objects.
  2. Ensure the id values are valid UUIDs retrieved from /api/v2/routing/skills.
  3. Verify that the skill IDs exist in your specific division scope.
resource "genesyscloud_routing_queue" "main" {
 name = "Support Queue"
 
 skills {
 id = "12345-67890-abcde" # Use full UUID, not map keys
 }
 
 # Additional skills can be added as separate blocks
 skills {
 id = "98765-43210-fghij"
 }
}

The suggestion above regarding API endpoints is correct, but the HCL structure must match the provider schema. If you still encounter validation errors, check your provider version. Outdated versions may have different schema requirements. Use terraform providers to verify you are on the latest release.