From 4770a8ed3f237c130beb9c6fa2306e115ca3536a Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sun, 9 Jun 2024 11:27:13 -0700 Subject: [PATCH] feat(oci): add SSH in --- tf/oci_common_private_network/nsg.tf | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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