We are using Genesys Cloud terraform provider 1.30.2 and have started working on building a large number of queues because the platform won't support more than 50 skills per agents and our envrionment requires much more than that to use skills. First, we use a setproduct function to create a list of unique queue names. Then we are using a for each loop to build queues with unique queue names based on the results of those sets. The terraform plan correctly shows the correct number of resulting queues and queue names, but during execution it starts complaining that the queues already exist for some reason (even though they didn't already exist). 138 of the 510 that should get created failed. If we review the logs, there is no attempt that can be found to create the same queue name twice.
This an example error it is showing when it 'fails' to create the queue.
error while trying to create queue: IFP_Medicare_ThisYear_CT. Err API Error: 400 - Queue name 'IFP_Medicare_ThisYear_CT' is currently in use by queue
When the apply finishes, we noticed that there indeed is an object that was created that matches the name of the queues it threw an errors about, but it doesn't function properly. For some reason the skillgroup assignments don't pull members into the queue properly (even though you can clearly see members in the skill group itself). Also, the queue object can't be deleted. If you attempt to delete it to attempt to re-run the job to create it, you get a message that the object was deleted successfully, yet the object is still in the GUI. It seems like the queues got created partially, but are somehow orphaned in some way and can't be managed properly.
We have terraform logs that we can provide. We attempted a second run to see if it would somehow overwrite or fix them, but it also failed. Logs cover both attempts.
Here is code for making the objects which seems to produce exactly what we're expecting.
locals {
IFPqueueNames = setproduct(["HealthCare_", "Medicare_"], ["ThisYear_", "NextYear_"], ["AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"])
IFPfinalQueueList = [for q in local.IFPqueueNames : "${q[0]}${q[1]}${q[2]}"]
}
resource "genesyscloud_routing_queue" "IFP_LicensedQueues" {
for_each = toset(local.IFPfinalQueueList)
name = "IFP_${each.key}"
skill_evaluation_method = "BEST"
skill_groups = [data.genesyscloud_routing_skill_group.IFP.id]
division_id = data.genesyscloud_auth_division.Home.id
media_settings_email {
alerting_timeout_sec = 300
service_level_duration_ms = 86400000
service_level_percentage = 0.8
}
media_settings_call {
alerting_timeout_sec = 8
service_level_duration_ms = 20000
service_level_percentage = 0.8
}
media_settings_callback {
alerting_timeout_sec = 30
service_level_duration_ms = 20000
service_level_percentage = 0.8
enable_auto_answer = true
}
whisper_prompt_id = data.genesyscloud_architect_user_prompt.whisperIfp.id
auto_answer_only = false
enable_manual_assignment = false
media_settings_chat {
alerting_timeout_sec = 30
service_level_duration_ms = 20000
service_level_percentage = 0.8
}
media_settings_message {
alerting_timeout_sec = 30
service_level_duration_ms = 20000
service_level_percentage = 0.8
}
acw_wrapup_prompt = "OPTIONAL"
calling_party_name = ""
enable_transcription = true
queue_flow_id = data.genesyscloud_flow.InQueueFlow.id
default_script_ids = {
CALL = data.genesyscloud_script.AgentUI.id
}
}