From 7d3ae8fb06bdab270f5f045d8863fead811c4d6e Mon Sep 17 00:00:00 2001
From: cosmindev <cosmin.tudor82@gmail.com>
Date: Thu, 4 Jan 2024 15:41:13 +0200
Subject: [PATCH] Fix issue #458 - default security list

---
 .../network_configuration.auto.tfvars         | 36 ++++++++++++++++++-
 .../network_configuration.auto.tfvars         |  6 ++--
 outputs.tf                                    |  2 +-
 3 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/examples/simple-example/input-configs-standards-options/network_configuration.auto.tfvars b/examples/simple-example/input-configs-standards-options/network_configuration.auto.tfvars
index 7deb62f..e9d0e8f 100644
--- a/examples/simple-example/input-configs-standards-options/network_configuration.auto.tfvars
+++ b/examples/simple-example/input-configs-standards-options/network_configuration.auto.tfvars
@@ -3,7 +3,7 @@
 # Licensed under the Universal Permissive License v 1.0 as shown at https: //oss.oracle.com/licenses/upl. #
 # Author: Cosmin Tudor                                                                                    #
 # Author email: cosmin.tudor@oracle.com                                                                   #
-# Last Modified: Wed Nov 15 2023                                                                          #
+# Last Modified: Thu Jan 04 2024                                                                          #
 # Modified by: Cosmin Tudor, email: cosmin.tudor@oracle.com                                               #
 # ####################################################################################################### #
 
@@ -30,6 +30,40 @@ network_configuration = {
           is_create_igw                    = false
           is_attach_drg                    = false
           block_nat_traffic                = false
+          default_security_list = {
+            display_name = "sl-lb"
+
+            egress_rules = [
+              {
+                description = "egress to 0.0.0.0/0 over ALL protocols"
+                stateless   = false
+                protocol    = "ALL"
+                dst         = "0.0.0.0/0"
+                dst_type    = "CIDR_BLOCK"
+              }
+            ]
+
+            ingress_rules = [
+              {
+                description  = "ingress from 0.0.0.0/0 over TCP22"
+                stateless    = false
+                protocol     = "TCP"
+                src          = "0.0.0.0/0"
+                src_type     = "CIDR_BLOCK"
+                dst_port_min = 22
+                dst_port_max = 22
+              },
+              {
+                description  = "ingress from 0.0.0.0/0 over TCP443"
+                stateless    = false
+                protocol     = "TCP"
+                src          = "0.0.0.0/0"
+                src_type     = "CIDR_BLOCK"
+                dst_port_min = 443
+                dst_port_max = 443
+              }
+            ]
+          }
 
           security_lists = {
 
diff --git a/examples/simple-example/network_configuration.auto.tfvars b/examples/simple-example/network_configuration.auto.tfvars
index e39f096..eade3b8 100644
--- a/examples/simple-example/network_configuration.auto.tfvars
+++ b/examples/simple-example/network_configuration.auto.tfvars
@@ -3,7 +3,7 @@
 # Licensed under the Universal Permissive License v 1.0 as shown at https: //oss.oracle.com/licenses/upl. #
 # Author: Cosmin Tudor                                                                                    #
 # Author email: cosmin.tudor@oracle.com                                                                   #
-# Last Modified: Mon Dec 11 2023                                                                          #
+# Last Modified: Thu Jan 04 2024                                                                          #
 # Modified by: Cosmin Tudor, email: cosmin.tudor@oracle.com                                               #
 # ####################################################################################################### #
 
@@ -30,7 +30,7 @@ network_configuration = {
           is_create_igw                    = false
           is_attach_drg                    = false
           block_nat_traffic                = false
-          default-security-list = {
+          default_security_list = {
             display_name = "sl-lb"
 
             egress_rules = [
@@ -230,7 +230,7 @@ network_configuration = {
               prohibit_public_ip_on_vnic = true
               route_table_id             = null
               route_table_key            = "RT-02-KEY"
-              security_list_keys         = ["SECLIST-DB-KEY"]
+              security_list_keys         = ["default_security_list"]
             }
           }
 
diff --git a/outputs.tf b/outputs.tf
index cf7b909..63ecded 100644
--- a/outputs.tf
+++ b/outputs.tf
@@ -3,7 +3,7 @@
 # Licensed under the Universal Permissive License v 1.0 as shown at https: //oss.oracle.com/licenses/upl. #
 # Author: Cosmin Tudor                                                                                    #
 # Author email: cosmin.tudor@oracle.com                                                                   #
-# Last Modified: Wed Jan 03 2024                                                                          #
+# Last Modified: Thu Jan 04 2024                                                                          #
 # Modified by: Cosmin Tudor, email: cosmin.tudor@oracle.com                                               #
 # ####################################################################################################### #