diff --git a/modules/subnet/subnet.tf b/modules/subnet/subnet.tf index b1d4248..e556620 100644 --- a/modules/subnet/subnet.tf +++ b/modules/subnet/subnet.tf @@ -29,7 +29,6 @@ resource "oci_core_subnet" "vcn_subnet" { vcn_id = var.vcn_id availability_domain = lookup(each.value, "availability_domain", null) != null ? local.ad_numbers_to_names[each.value.availability_domain] : null - defined_tags = var.defined_tags dhcp_options_id = local.dhcp_default_options display_name = lookup(each.value, "name", each.key) @@ -41,7 +40,8 @@ resource "oci_core_subnet" "vcn_subnet" { #prohibit_internet_ingress = var.enable_ipv6 && lookup(each.value,"type","public") == "public" ? each.value.prohibit_internet_ingress : false prohibit_public_ip_on_vnic = lookup(each.value, "type", "public") == "public" ? false : true route_table_id = lookup(each.value, "type", "public") == "public" ? var.ig_route_id : var.nat_route_id - security_list_ids = null + security_list_ids = lookup(each.value, "security_list_ids", null) + lifecycle { ignore_changes = [defined_tags, dns_label, freeform_tags] diff --git a/terraform.tfvars.example b/terraform.tfvars.example index 06e467e..bf5dd82 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -107,4 +107,5 @@ attached_drg_id = null # sub1 = {name = "subnet1",cidr_block = "10.0.4.0/24"} # sub2 = {cidr_block="10.0.5.0/24",type="private"} # sub3 = {cidr_block="10.0.6.0/24",availability_domain=1} +# sub4 = {cidr_block="10.0.7.0/24",security_list_ids =["ocid1.securitylist.oc1.iad.xxxxx", "ocid1.securitylist.oc1.iad.xxxxxx"]} #} \ No newline at end of file