diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 1406866..1f1cd0d 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -15,6 +15,9 @@ Given a version number MAJOR.MINOR.PATCH: - PATCH version when making backwards compatible bug fixes. == 4.0.0 (not released) +* Ignored lifecycle changes for defined_tags, freeform_tags + +== 3.5.1 (September 5, 2022)) * removed DRG submodule, now promoted to terraform-oci-drg module (feat: ) * updated examples to use GitHub repo as source () diff --git a/modules/subnet/subnet.tf b/modules/subnet/subnet.tf index 1207163..8be1354 100644 --- a/modules/subnet/subnet.tf +++ b/modules/subnet/subnet.tf @@ -24,6 +24,10 @@ resource "oci_core_subnet" "vcn_subnet" { 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 + + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } } data "oci_core_dhcp_options" "dhcp_options" { diff --git a/vcn.tf b/vcn.tf index 26c7b8f..18ad13b 100644 --- a/vcn.tf +++ b/vcn.tf @@ -12,6 +12,10 @@ resource "oci_core_vcn" "vcn" { freeform_tags = var.freeform_tags defined_tags = var.defined_tags + + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } } #Module for Subnet diff --git a/vcn_gateways.tf b/vcn_gateways.tf index 5fd605e..f9f2d78 100644 --- a/vcn_gateways.tf +++ b/vcn_gateways.tf @@ -14,6 +14,10 @@ resource "oci_core_internet_gateway" "ig" { vcn_id = oci_core_vcn.vcn.id + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } + count = var.create_internet_gateway == true ? 1 : 0 } @@ -76,6 +80,10 @@ resource "oci_core_route_table" "ig" { vcn_id = oci_core_vcn.vcn.id + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } + count = var.create_internet_gateway == true ? 1 : 0 } @@ -103,6 +111,10 @@ resource "oci_core_service_gateway" "service_gateway" { vcn_id = oci_core_vcn.vcn.id + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } + count = var.create_service_gateway == true ? 1 : 0 } @@ -120,6 +132,10 @@ resource "oci_core_nat_gateway" "nat_gateway" { vcn_id = oci_core_vcn.vcn.id + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } + count = var.create_nat_gateway == true ? 1 : 0 } @@ -195,6 +211,10 @@ resource "oci_core_route_table" "nat" { vcn_id = oci_core_vcn.vcn.id + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } + count = var.create_nat_gateway == true ? 1 : 0 } @@ -217,4 +237,8 @@ resource "oci_core_local_peering_gateway" "lpg" { #Optional peer_id = can(each.value.peer_id) == false ? null : each.value.peer_id route_table_id = can(each.value.route_table_id) == false ? null : each.value.route_table_id + + lifecycle { + ignore_changes = [defined_tags, freeform_tags] + } }