Get/Reuse attribute value

Hi!

Can I reuse the inserted value of an attribute in an object array in another?

Ex:

 dynamic "http_listener" {
    for_each = toset(var.http_listener)
    content {
      name                                 = "listnr${http_listener.value.name}" << THIS VALUE
      frontend_port_name      = foo
      protocol                            = "foo"
      host_names                     = foo
      ssl_certificate_name       = foo
      frontend_ip_configuration_name = "foo"
    }
  }



  dynamic "request_routing_rule" {
    for_each = toset(var.routing_rule)

    content {
      name                                = "rrule${request_routing_rule.value.name}"
      http_listener_name         =  HERE <<
      backend_address_pool_name  = foo
      backend_http_settings_name = foo
      rule_type                  = foo
      priority                   = foo
    }
  }

could you help me ?
tks!

No, there’s no way to do exactly that.

You’d have to restructure the data you’re applying for_each to so the necessary value can be retrieved from it.

so my suspicions were confirmed! thanks