Using multiple subnet exports in source_address_prefixes in network security group rules

I need to add the IP address prefixes from two azure subnets to a NSG.

For example, subnet1 and subnet2.

This seems to work if i have a single subnet, but not multiple.

for instance, this works:

source_address_prefixes = azurerm_subnet.subnet1.address_prefixes

But this does not:

source_address_prefixes = [“azurerm_subnet.subnet1.address_prefixes”,“azurerm_subnet.subnet2.address_prefixes”]

I also tried these which didn’t work:

source_address_prefixes = azurerm_subnet.subnet1.address_prefixes,azurerm_subnet.subnet2.address_prefixes

source_address_prefixes = [azurerm_subnet.subnet1.address_prefixes,azurerm_subnet.subnet2.address_prefixes]

Can anyone offer guidance on how to add multiple subnet address prefixes via outputs?

Thank You.