I am still getting used to using Terraform and have the following question.
I have an array in a TFVARS file;
extproviders = [ "production" , "support" ]
i am using thisto call a module
module userpoolclientN {
count = length(var.extproviders)
source = "../modules/cognito"
basename = var.extproviders[count.index]
}
what i would like to do is create a new array that attaches 'odd' 'even' to each variable. I dont want the user to input this as the extproviders is used elsewhere in the code.
extproviders_new = [ "production_odd" ,"production_even" , "support_odd", "support_even" ]
module userpoolclientN {
count = length(var.extproviders_new)
source = "../modules/cognito"
basename = var.extproviders_new[count.index]
}
I am still learning Terraform, understand i cant use a for loop to accomplish this. Is there another way?
for_eachso that theforexpression can be used directly as the module argument (also could then removebasenameargument)? It would simplify and stabilize the usage and answer.