-
Notifications
You must be signed in to change notification settings - Fork 0
/
nsgs.tf
30 lines (26 loc) · 959 Bytes
/
nsgs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module "nsg_lb" {
source = "./modules/nsg"
rg_name = module.rg1.rg.name
nsg_name = "nsg_loadbalancer_vms"
}
module "nsg_appgw" {
source = "./modules/nsg"
rg_name = module.rg1.rg.name
nsg_name = "nsg_appgw_vms"
}
resource "azurerm_network_interface_security_group_association" "vm0_assoc" {
network_interface_id = module.vm0.nic.id
network_security_group_id = module.nsg_lb.nsg.id
}
resource "azurerm_network_interface_security_group_association" "vm1_assoc" {
network_interface_id = module.vm1.nic.id
network_security_group_id = module.nsg_lb.nsg.id
}
resource "azurerm_network_interface_security_group_association" "vm2_assoc" {
network_interface_id = module.vm2.nic.id
network_security_group_id = module.nsg_appgw.nsg.id
}
resource "azurerm_network_interface_security_group_association" "vm3_nsg_assoc" {
network_interface_id = module.vm3.nic.id
network_security_group_id = module.nsg_appgw.nsg.id
}