@@ -146,15 +146,15 @@ resource "azurerm_network_security_group" "nsg" {
146146
147147resource "azurerm_network_security_rule" "allow_inbound" {
148148 for_each = toset ([
149- " 22 " , " 68" , " 443" , " 2379" , " 2380" , " 2381" , " 10010" , " 2112" , " 30000-32767" ,
149+ " 68" , " 443" , " 2379" , " 2380" , " 2381" , " 10010" , " 2112" , " 30000-32767" ,
150150 " 3260" , " 5900" , " 6080" , " 6443" , " 6444" , " 8181" , " 8443" , " 8444" , " 8472" ,
151151 " 9091" , " 9099" , " 9345" , " 9796" , " 10245" , " 10246-10249" , " 10250" , " 10251" ,
152152 " 10252" , " 10256" , " 10257" , " 10258" , " 10259"
153153 ])
154154
155155 name = " ${ var . prefix } -allow-inbound-${ each . key } "
156156 priority = 100 + index ([
157- " 22 " , " 68" , " 443" , " 2379" , " 2380" , " 2381" , " 10010" , " 2112" , " 30000-32767" ,
157+ " 68" , " 443" , " 2379" , " 2380" , " 2381" , " 10010" , " 2112" , " 30000-32767" ,
158158 " 3260" , " 5900" , " 6080" , " 6443" , " 6444" , " 8181" , " 8443" , " 8444" , " 8472" ,
159159 " 9091" , " 9099" , " 9345" , " 9796" , " 10245" , " 10246-10249" , " 10250" , " 10251" ,
160160 " 10252" , " 10256" , " 10257" , " 10258" , " 10259"
@@ -170,6 +170,20 @@ resource "azurerm_network_security_rule" "allow_inbound" {
170170 network_security_group_name = azurerm_network_security_group. nsg . name
171171}
172172
173+ resource "azurerm_network_security_rule" "allow_ssh" {
174+ name = " ${ var . prefix } -allow-inbound-22"
175+ priority = 134
176+ direction = " Inbound"
177+ access = " Allow"
178+ protocol = " Tcp"
179+ source_port_range = " *"
180+ destination_port_range = " 22"
181+ source_address_prefixes = var. ssh_public_ip_source_addresses
182+ destination_address_prefix = " *"
183+ resource_group_name = azurerm_resource_group. rg . name
184+ network_security_group_name = azurerm_network_security_group. nsg . name
185+ }
186+
173187resource "azurerm_network_security_rule" "allow_outbound" {
174188 name = " ${ var . prefix } -allow-outbound"
175189 priority = 100
0 commit comments