I have an app settings configuration that needs to be done for more than 90 app services, these settings are basically adding keys for integration with azure app insights.
For creating and configuring app services, we have a built-in module.
For the app settings part we currently have this through an env with map values:
variable “app_settings” {
description = “A key-value pair of App Settings.”
type = map(string)
default = {}
}
And in the directory of each webapp I only specify the settings I need:
app_settings = {
“SPRING_PROFILES_ACTIVE” = “dev”
}
I would like to put these settings in the default of my variable, but my question is if I can make conditions, for example:
If the environment is dev: take the following block:
variable “app_settings” {
description = “A key-value pair of App Settings.”
type = map(string)
default = {
“SPRING_PROFILES_ACTIVE” = “dev”
}
}
If it’s hml get the following block:
variable “app_settings” {
description = “A key-value pair of App Settings.”
type = map(string)
default = {
“SPRING_PROFILES_ACTIVE” = “hml”
}
}
I would like to do this at the module level so as not to configure more than 90 webapps with such a simple configuration.