Skip to content

Commit 7aba082

Browse files
authored
fix: Compartment AD listing, ignore lifecycle changes (#50)
* Use compartment_id for availability_domain data source Signed-off-by: Devon Crouse <[email protected]> * Ignore changes for automatic tagging reported each apply Signed-off-by: Devon Crouse <[email protected]> Signed-off-by: Devon Crouse <[email protected]>
1 parent 28c4468 commit 7aba082

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

compute.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ resource "oci_core_instance" "bastion" {
3434

3535
# prevent the bastion from destroying and recreating itself if the image ocid changes
3636
lifecycle {
37-
ignore_changes = [source_details[0].source_id]
37+
ignore_changes = [freeform_tags, source_details[0].source_id]
3838
}
3939

4040
metadata = {

datasources.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44
data "oci_identity_availability_domain" "ad" {
5-
compartment_id = var.tenancy_id
5+
compartment_id = var.compartment_id
66
ad_number = var.availability_domain
77
}
88

security.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ resource "oci_core_security_list" "bastion" {
2626
}
2727
}
2828
}
29+
30+
lifecycle {
31+
ignore_changes = [freeform_tags]
32+
}
33+
2934
vcn_id = var.vcn_id
3035
}

subnets.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ resource "oci_core_subnet" "bastion" {
1111
route_table_id = var.ig_route_id
1212
security_list_ids = [oci_core_security_list.bastion.id]
1313
vcn_id = var.vcn_id
14+
15+
lifecycle {
16+
ignore_changes = [freeform_tags]
17+
}
1418
}

0 commit comments

Comments
 (0)