How to Pass Multiple NIC ids to Create Azure Windows VM(s)

Wanting to Create multiple VMs via TF using modules. I already have a nic and windows vm module.

In my nic module, i’m able to create nic(s)
resource “azurerm_network_interface” “nic” {
for_each = var.nic_name
name = “${each.value}-nic”
location = var.nic_location
resource_group_name =var.nic_resource_group

ip_configuration {
name = “internalNic”
subnet_id = var.nic_subnet_id
private_ip_address_allocation = “Dynamic”
}
tags = var.tags
}

and output as either a list/map
output “nic_map_ids” { #Output as map
value = tomap({ for k, s in azurerm_network_interface.nic : k => s.id })
}

output “nic_string_ids” { #Output as string
value = [
for ids in azurerm_network_interface.nic : ids.id
]
}

below is a sample of the output
nic_map_ids = tomap({
“testVM01” = “/subscriptions/subID/resourceGroups/test-RG/providers/Microsoft.Network/networkInterfaces/testVM01-nic”
“testVM02” = “/subscriptions/subID/resourceGroups/test-RG/providers/Microsoft.Network/networkInterfaces/testVM02-nic”
})
nic_string_ids = [
“/subscriptions/subID/resourceGroups/test-RG/providers/Microsoft.Network/networkInterfaces/testVM01-nic”,
“/subscriptions/subID/resourceGroups/test-RG/providers/Microsoft.Network/networkInterfaces/testVM02-nic”,
]

What I want to do is use my vm module below and pass either list/map to network_interface_ids

resource “azurerm_windows_virtual_machine” “WindowsVM” {
for_each = var.vm_names
name = each.value
resource_group_name = var.vm_rg_name
location = var.vm_location
size = var.vm_size
admin_username = var.admin_username
admin_password = var.admin_password #
network_interface_ids = [

#how to pass map/list values to associate with vm_names
]
…# removed additional attributes/props to save time
}

variables for windows module
variable “vm_names” {
type = set(string)
}
variable “vm_nic_ids” {
type = map(string) # can also be set(string)
}

Appreciate the help in advice. I’m trying to make the NIC its own module.