Skip to content

Commit 52158fb

Browse files
authored
Ignore lifecycle changes for defined/freeform tags (#100)
Signed-off-by: Devon Crouse <[email protected]> Signed-off-by: Devon Crouse <[email protected]>
1 parent 726fd2f commit 52158fb

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

CHANGELOG.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Given a version number MAJOR.MINOR.PATCH:
1515
- PATCH version when making backwards compatible bug fixes.
1616
1717
== 4.0.0 (not released)
18+
* Ignored lifecycle changes for defined_tags, freeform_tags
19+
20+
== 3.5.1 (September 5, 2022))
1821
* removed DRG submodule, now promoted to terraform-oci-drg module (feat: )
1922
* updated examples to use GitHub repo as source ()
2023

modules/subnet/subnet.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ resource "oci_core_subnet" "vcn_subnet" {
2424
prohibit_public_ip_on_vnic = lookup(each.value, "type", "public") == "public" ? false : true
2525
route_table_id = lookup(each.value, "type", "public") == "public" ? var.ig_route_id : var.nat_route_id
2626
security_list_ids = null
27+
28+
lifecycle {
29+
ignore_changes = [defined_tags, freeform_tags]
30+
}
2731
}
2832

2933
data "oci_core_dhcp_options" "dhcp_options" {

vcn.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ resource "oci_core_vcn" "vcn" {
1212

1313
freeform_tags = var.freeform_tags
1414
defined_tags = var.defined_tags
15+
16+
lifecycle {
17+
ignore_changes = [defined_tags, freeform_tags]
18+
}
1519
}
1620

1721
#Module for Subnet

vcn_gateways.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ resource "oci_core_internet_gateway" "ig" {
1414

1515
vcn_id = oci_core_vcn.vcn.id
1616

17+
lifecycle {
18+
ignore_changes = [defined_tags, freeform_tags]
19+
}
20+
1721
count = var.create_internet_gateway == true ? 1 : 0
1822
}
1923

@@ -76,6 +80,10 @@ resource "oci_core_route_table" "ig" {
7680

7781
vcn_id = oci_core_vcn.vcn.id
7882

83+
lifecycle {
84+
ignore_changes = [defined_tags, freeform_tags]
85+
}
86+
7987
count = var.create_internet_gateway == true ? 1 : 0
8088
}
8189

@@ -103,6 +111,10 @@ resource "oci_core_service_gateway" "service_gateway" {
103111

104112
vcn_id = oci_core_vcn.vcn.id
105113

114+
lifecycle {
115+
ignore_changes = [defined_tags, freeform_tags]
116+
}
117+
106118
count = var.create_service_gateway == true ? 1 : 0
107119
}
108120

@@ -120,6 +132,10 @@ resource "oci_core_nat_gateway" "nat_gateway" {
120132

121133
vcn_id = oci_core_vcn.vcn.id
122134

135+
lifecycle {
136+
ignore_changes = [defined_tags, freeform_tags]
137+
}
138+
123139
count = var.create_nat_gateway == true ? 1 : 0
124140
}
125141

@@ -195,6 +211,10 @@ resource "oci_core_route_table" "nat" {
195211

196212
vcn_id = oci_core_vcn.vcn.id
197213

214+
lifecycle {
215+
ignore_changes = [defined_tags, freeform_tags]
216+
}
217+
198218
count = var.create_nat_gateway == true ? 1 : 0
199219
}
200220

@@ -217,4 +237,8 @@ resource "oci_core_local_peering_gateway" "lpg" {
217237
#Optional
218238
peer_id = can(each.value.peer_id) == false ? null : each.value.peer_id
219239
route_table_id = can(each.value.route_table_id) == false ? null : each.value.route_table_id
240+
241+
lifecycle {
242+
ignore_changes = [defined_tags, freeform_tags]
243+
}
220244
}

0 commit comments

Comments
 (0)