I have a modul which is responsible to create azure private endpoints. For one resource I would like to create two private enpoints, hence I use terraform forech
loop as following:
module "azure_private_endpoint" {
source = "../azure-private-endpoint"
for_each = { for k, v in var.endpoints : k => merge(v, { index = index(keys(var.endpoints), k) + 1 }) }
name = "testpe_${each.key}_${each.value.type}"
location = var.resource_location
resource-group-name = "MyResourceGroup"
subnet-key = each.value.subnet
....
}
My problem is now, that private endpoints should not be created in parallel. They should be created after each other.
How can I realise this requirement in a single call to the module?