diff --git a/tf/oci_common_private_network/nsg.tf b/tf/oci_common_private_network/nsg.tf index a15cf06f..0ae11614 100644 --- a/tf/oci_common_private_network/nsg.tf +++ b/tf/oci_common_private_network/nsg.tf @@ -14,13 +14,27 @@ locals { } } -resource "oci_core_network_security_group_security_rule" "this" { +resource "oci_core_network_security_group_security_rule" "icmp_in" { direction = "INGRESS" network_security_group_id = oci_core_network_security_group.this.id protocol = local.protocol_number.icmp source = "0.0.0.0/0" } +resource "oci_core_network_security_group_security_rule" "ssh_in" { + direction = "INGRESS" + network_security_group_id = oci_core_network_security_group.this.id + protocol = local.protocol_number.tcp + source = "0.0.0.0/0" + + tcp_options { + destination_port_range { + max = 22 + min = 22 + } + } +} + output "nsg_id" { value = oci_core_network_security_group.this.id } \ No newline at end of file