We have developed terraform code for deploying Application Gateway few years ago. Around that time, it was working fine.
But now, it is showing error "Unresolved Reference redirect" in code
dynamic "redirect_configuration" {
for_each = [for x in var.request_routing_rule_set : x if x.**redirect**]
content {
name = redirect_configuration.value["redirect_conf_name"]
redirect_type = "Permanent"
target_listener_name = redirect_configuration.value["target_listener_name"]
include_path = true
include_query_string = true
and Error "Unresolved Reference name" in this application gateway module
resource "azurerm_key_vault_secret" "backend_address_pool" {
for_each = { for idx, record in var.backend_address_pool_name_list : idx => record }
name = each.value.**name**
value = format("%s/backendAddressPools/%s", azurerm_application_gateway.cluster_agw.id, each.value.**name**)
key_vault_id = var.key_vault_id
The var file was having before.
variable "request_routing_rule_set" {
description = "request_routing_rule_set"
variable "backend_address_pool_name_list" {
description = "backend_address_pool_list"
}
How to eliminate this error? I dont want to add backend address pools in var file. Because it is already mentioned in our TEST Env as
backend_address_pool_name_list = [
{
name = local.pool_name
},