-
Notifications
You must be signed in to change notification settings - Fork 2
/
nsg.tf
36 lines (35 loc) · 976 Bytes
/
nsg.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
31
32
33
34
35
36
resource azurerm_network_security_group nsg_webserver {
name = "NSG1"
location = var.Location
resource_group_name = var.ResG
security_rule {
name = "WebApp_Inbound"
access = "Allow"
priority = "2010"
protocol = "*"
direction = "Inbound"
source_port_range = "*"
source_address_prefix = "*"
destination_port_ranges = ["80", "8080"]
destination_address_prefixes = ["172.50.2.10"]
}
security_rule {
name = "MGT_Inbound"
access = "Allow"
priority = "2000"
protocol = "*"
direction = "Inbound"
source_port_range = "*"
source_address_prefix = "*"
destination_port_ranges = ["22"]
destination_address_prefixes = ["172.50.2.10"]
}
depends_on = [azurerm_virtual_machine.webserver]
tags = {
Version = var.Version
}
}
resource azurerm_subnet_network_security_group_association sNet-Asoc1 {
subnet_id = "${azurerm_subnet.sNet-1.id}"
network_security_group_id = "${azurerm_network_security_group.nsg_webserver.id}"
}