Skip to content

Commit a240a48

Browse files
authored
Merge pull request #96 from hyder/91-admin-host
prevent the bastion/admin from destroying and recreating itse…
2 parents 5cd8283 + d94c131 commit a240a48

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

modules/base/admin/compute.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ resource "oci_core_instance" "admin" {
2020
subnet_id = oci_core_subnet.admin[0].id
2121
}
2222

23+
# prevent the bastion from destroying and recreating itself if the image ocid changes
24+
lifecycle {
25+
ignore_changes = [source_details[0].source_id]
26+
}
27+
2328
shape = var.oci_admin.admin_shape
2429

2530
source_details {

modules/base/bastion/compute.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ resource "oci_core_instance" "bastion" {
2020
user_data = data.template_cloudinit_config.bastion[0].rendered
2121
}
2222

23+
# prevent the bastion from destroying and recreating itself if the image ocid changes
24+
lifecycle {
25+
ignore_changes = [source_details[0].source_id]
26+
}
27+
2328
shape = var.oci_bastion.bastion_shape
2429

2530
source_details {
@@ -32,4 +37,4 @@ resource "oci_core_instance" "bastion" {
3237
}
3338

3439
count = var.oci_bastion.bastion_enabled == true ? 1 : 0
35-
}
40+
}

0 commit comments

Comments
 (0)