File tree Expand file tree Collapse file tree 5 files changed +16
-9
lines changed
Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,6 @@ resource "oci_core_instance" "operator" {
3939 }
4040
4141 is_pv_encryption_in_transit_enabled = var. enable_pv_encryption_in_transit
42- # prevent the operator from destroying and recreating itself if the image ocid changes
43- lifecycle {
44- ignore_changes = [source_details [0 ]. source_id ]
45- }
4642
4743 metadata = {
4844 ssh_authorized_keys = (var.ssh_public_key != " " ) ? var.ssh_public_key : (var.ssh_public_key_path != " none" ) ? file (var. ssh_public_key_path ) : " "
@@ -67,6 +63,11 @@ resource "oci_core_instance" "operator" {
6763
6864 state = var. operator_state
6965
66+ # prevent the operator from destroying and recreating itself if the image ocid/tagging/user data changes
67+ lifecycle {
68+ ignore_changes = [freeform_tags , metadata [" user_data" ], source_details [0 ]. source_id ]
69+ }
70+
7071 timeouts {
7172 create = " 60m"
7273 }
Original file line number Diff line number Diff line change @@ -10,9 +10,8 @@ data "oci_core_services" "all_oci_services" {
1010}
1111
1212data "oci_identity_availability_domain" "ad" {
13- compartment_id = var. tenancy_id
14-
15- ad_number = var. availability_domain
13+ compartment_id = var. compartment_id
14+ ad_number = var. availability_domain
1615}
1716
1817data "oci_identity_tenancy" "tenancy" {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ output "operator_instance_principal_group_name" {
1010}
1111
1212output "operator_subnet_id" {
13- value = data . oci_core_instance . operator . subnet_id
13+ value = oci_core_subnet . operator . id
1414}
1515
1616output "operator_nsg_id" {
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ resource "oci_core_security_list" "operator" {
6161 compartment_id = var. compartment_id
6262 display_name = var. label_prefix == " none" ? " operator" : " ${ var . label_prefix } -operator"
6363 freeform_tags = var. freeform_tags
64+ vcn_id = var. vcn_id
6465
6566 # egress rule to the same subnet to allow users to use OCI Bastion service to connect to the operator
6667 egress_security_rules {
@@ -73,5 +74,7 @@ resource "oci_core_security_list" "operator" {
7374 }
7475 }
7576
76- vcn_id = var. vcn_id
77+ lifecycle {
78+ ignore_changes = [freeform_tags ]
79+ }
7780}
Original file line number Diff line number Diff line change @@ -11,4 +11,8 @@ resource "oci_core_subnet" "operator" {
1111 route_table_id = var. nat_route_id
1212 security_list_ids = [oci_core_security_list . operator . id ]
1313 vcn_id = var. vcn_id
14+
15+ lifecycle {
16+ ignore_changes = [freeform_tags ]
17+ }
1418}
You can’t perform that action at this time.
0 commit comments