-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecurity_group.tf
27 lines (27 loc) · 969 Bytes
/
security_group.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
resource "azurerm_network_security_group" "security_group" {
name = "${var.prefix}-sg"
location = var.location
resource_group_name = azurerm_resource_group.app_rg.name
security_rule {
name = "SSH"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
source_address_prefixes = local.external_ips
destination_port_ranges = ["22"]
destination_address_prefix = "*"
}
security_rule {
name = "HTTP"
priority = 101
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
source_address_prefix = "*"
destination_port_ranges = ["80", "443"]
destination_address_prefix = "*"
}
}