I am trying out a for_each loop to build 21 web apps in Azure. For other resources that do not use a for_each loop I use the following to make the name
Azure App Service Plan
resource “azurerm_app_service_plan” “asp” {
name=join("",[“asp-”,var.platform,"-",var.environment,"-"])
…
I want to do something similar when looping through a list of webapps. In my variables file I have a list of 21 webapps. In my webapps.tf file I am doing the following:
resource “azurerm_app_service” “web” {
for_each = var.webapps
name = each.value
…
I was hoping to something like name= each.value join("",[“web-”,var.platform,"-",var.environment,"-"])
But that does not work.
Any ideas on how I might pull this off?