I'm passing variables to multiple modules using the code below. My questions is, is there a better way to do this? Perhaps a file with just the variables I'm passing to each module or a file that can be injected at run time. The code below works fine running from an Azure DevOps Pipeline, just trying to see if there was a simpler way to do the same with less lines of code.
Thanks,
======================================================
module network {
source = "./Network"
prdrgname = azurerm_resource_group.MYRG-AZ-EUS-MAIN-01.name
prdlocation = azurerm_resource_group.MYRG-AZ-EUS-MAIN-01.location
drrgname = azurerm_resource_group.MYRG-AZ-WUS-BC-01.name
drlocation = azurerm_resource_group.MYRG-AZ-WUS-BC-01.location
}
module compute {
source = "./Compute"
prdrgname = azurerm_resource_group.MYRG-AZ-EUS-MAIN-01.name
prdlocation = azurerm_resource_group.MYRG-AZ-EUS-MAIN-01.location
drrgname = azurerm_resource_group.MYRG-AZ-WUS-BC-01.name
drlocation = azurerm_resource_group.MYRG-AZ-WUS-BC-01.location
}
============================================================