give me a terraform module that will run several times using different service…
- User
give me a terraform module that will run several times using different service principals on a tfvars file, it will also run with a nested loop for_each for every branch I specify on a variable list, the module should deploy a federated identity on azure
- Assistant
Here is a possible Terraform module that you can use to deploy a federated identity on Azure:
codevariable "branches" { type = list(string) default = [] } variable "service_principals" { type = list(string) default = [] } module "federated_identity" { for_each = var.branches source = "path/to/federated_identity_module" branch = each.value } resource "azurerm_service_principal" "federated_identity" { for_each = var.service_principals application_id = module.federated_identity[each.key].application_id }