title: Azure associating security group with multiple network interfaces and load balancer with multiple subnets using Terraform
body: <p>I've built an environment inside Azure using Terraform which I've created virtual network, multiple subnets, security groups (in the amount of the subnets), network interfaces (in the amount of virtual machine), load balancer, virtual machines, etc.
  I'm trying to associate each security group with multiple network interfaces but haven't found a solution yet. In addition, I facing issues associating my load balancer with multiple subnets.</p>
  
  <p>Let's say that I have in my environment 4 subnets, 4 security groups, 8 NICs (2 NICs in each subnet) and 1 load balancer. I want to associate each SG within the specific subnet with 2 NICs inside that subnet and then associate my load balancers with 2 subnets out of my 4 subnets.</p>
  
  <p>In Terraform's documentation associating SG with NIC works with one specific NIC id and not many:
  <a href="https://i.stack.imgur.com/CB7FP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CB7FP.png" alt="enter image description here"></a></p>
  
  <p>Moreover, In Terraform's documentation associating load balancer with subnet works with one specific subnet id and not many:
  <a href="https://i.stack.imgur.com/b6Nrr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b6Nrr.png" alt="enter image description here"></a></p>
  
  <p>How do I do handle these multiple associations?
  Thank you.</p>