Skip to content

Commit f1a5ea4

Browse files
authored
fix: Added additional rule to workers nsg to allow ssh (#498)
Closes #497
1 parent a01dca5 commit f1a5ea4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

modules/network/nsgs.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,27 @@ resource "oci_core_network_security_group_security_rule" "workers_healthcheck_in
299299
}
300300
}
301301

302+
resource "oci_core_network_security_group_security_rule" "workers_ssh_ingress_from_bastion" {
303+
network_security_group_id = oci_core_network_security_group.workers.id
304+
description = "Allow ssh access to workers via Bastion host"
305+
direction = "INGRESS"
306+
protocol = local.tcp_protocol
307+
source = local.bastion_subnet
308+
source_type = "CIDR_BLOCK"
309+
310+
stateless = false
311+
312+
tcp_options {
313+
destination_port_range {
314+
min = local.ssh_port
315+
max = local.ssh_port
316+
}
317+
}
318+
319+
count = var.allow_worker_ssh_access == true ? 1 : 0
320+
321+
}
322+
302323
# internal lb nsg and rules
303324
resource "oci_core_network_security_group" "int_lb" {
304325
compartment_id = var.compartment_id

0 commit comments

Comments
 (0)