I'm here again, needing help with Terraform!
I am creating several queues with bullseye_rings. For this I am relying on a csv file.
Within the bullseye_rings, each queue has a different amount of member groups.
In the csv file, I have to take into consideration as many member groups as possible.
When a queue does not have the maximum possible member groups, I leave that value blank, but the system returns an error.
A quick solution I have found is, to repeat the member groups, until the maximum number is reached.
This really works for me, but I wonder if there is another solution.
for example, I am creating two queues, one with two rings, and one with three.
In my csv file, I have to contemplate the maximum number of possibilities, that is, three.
I still don't understand at the moment. You're reading csv data into terraform variables? The indexing of a data source does not seem like valid terraform code to me.
If you're saving all the skill names in bull_skills_to_remove, I suggest creating separate data sources for each of them and referencing them individually in the skills_to_remove array.
To answer your other question, we have another resource called genesyscloud_routing_skill_group. You can create skill groups separately with this.
Regarding the first point, I am investigating a possible solution.
I am going to create two queues. Queue A has two bullseye_rings. Queue B has one bullseye_rings.
The data about the queues I have in a .csv, but I think this is not relevant.
I attach a screenshot of the .tf in case it helps to understand.
I'm not aware of any way to recursively generate the bullseye_rings sets as they are nested within the resource. I would recommend checking out some hashicorp forums to discover if it has been/can be done. Generally, we use this forum to provide help regarding our own API and tools.
However, if you're only creating two queues, and they do differ in some way, I would recommend coding them manually as separate resources. It means more lines of code, but in the end you will have control over both of them, and will be able to easily edit/destroy them as you please.
To answer your second question; the skill_groups array allows you to do this. Example:
resource "genesyscloud_routing_queue" "queue" {
skill_groups = [data.genesyscloud_routing_skill_group.skillgroup.id]
// and for regular groups
groups = [data.genesyscloud_group.group.id]
}
This small example worked fine for me using v1.13.0
resource "genesyscloud_routing_queue" "queue" {
name = "a test tf queue 2803"
skill_groups = [genesyscloud_routing_skill_group.skillgroup.id]
}
resource "genesyscloud_routing_skill_group" "skillgroup" {
name = "a test tf skill group 2803"
}