I Have written below code to attach security group with network interface using terraform.
resource "azurerm_network_interface_security_group_association" "attach_Nic_Nsg" {
count = 2
network_interface_id = "${azurerm_network_interface.network_interface[count.index].id}"
network_security_group_id = module.security_group.security_group_id
}
When i am executing terraform plan i am getting below error.
How to attach network security group for multiple Nic?
resource "azurerm_network_interface_security_group_association" "attach_Nic_Nsg" { network_interface_id = azurerm_network_interface.testnic.id network_security_group_id = azurerm_network_security_group.testnsg.id }