I am creating a module on top of the azurerm_app_service. I don’t want to grow the input variable list to collect all the possible values for the bigger blocks eg site_config
.
variable var1{}
variable var2{}
..
..
..
variable varN{}
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
site_config {
key1 = var.var1
key2 = var.var2
...
...
keyN = var.varN
}
app_settings = {
"SOME_KEY" = "some-value"
}
}
I want to parametrize the entire block itself.
something like this
variable var_block{
type = map()
}
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
site_config {
var.var_block
}
app_settings = {
"SOME_KEY" = "some-value"
}
}
Looking for something like **kwargs in the python world.
Is it possible to achieve?