I have a variable defined as,

```
variable "ssh_permit" {
  type = list(object({ name = string, ip = string }))
  default = [
    {
      name = "alice"
      ip = "1.1.1.1"
    },
    {
      name = "bob"
      ip = "2.2.2.2"
    },
  ]
}

```

I'm attempting to use a `for` loop, to post-process this value into an object that can be assigned to [the `security_rule` attribute on an Azure NSG](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group#security_rule).

[The docs seem to indicate that this should be possible.](https://www.terraform.io/docs/language/attr-as-blocks.html#arbitrary-expressions-with-argument-syntax)

However, I get:

```
Error: Incorrect attribute value type

  on test.tf line 81, in resource "azurerm_network_security_group" "foo_nsg":
  81:   security_rule = [for idx, rule in var.ssh_permit: {
  82:       name = "allow-${rule.name}"
  83:       priority = 100 + idx
  84:       direction = "Inbound"
  85:       access = "Allow"
  86:       protocol = "TCP"
  87:       source_address_prefix = rule.ip
  88:       source_port_range = "*"
  89:       destination_address_prefix = "*"
  90:       destination_port_range = "22"
  91:     } ]
    |----------------
    | var.ssh_permit is list of object with 2 elements

Inappropriate value for attribute "security_rule": element 0: attributes
"description", "destination_address_prefixes",
"destination_application_security_group_ids", "destination_port_ranges",
"source_address_prefixes", "source_application_security_group_ids", and
"source_port_ranges" are required.

```

It is like Terraform is ignoring the fact that there's a for loop there. Yes, `var.ssh_permit` is a list of object w/ 2 elements, but it gets transformed into the appropriate object for `security_element`.

(I've gotten this to work with the dynamic block syntax, but I'd like to ignore that for the purposes of the question, since I'm trying to also learn the TF syntax for `for` loops. It appears that it should work here, so I'd like to understand why not.)