Skip to content

Commit 1dea0f8

Browse files
Bug 35445029 - MAA: WLS for OCI requiring DB OCID for scale out (#209)
1 parent e1b6a69 commit 1dea0f8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

terraform/modules/compute/wls_compute/data_sources.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ data "oci_database_autonomous_database" "atp_db" {
5252
}
5353

5454
data "template_file" "atp_nsg_id" {
55-
count = local.is_atp_db ? 1 : 0
55+
count = local.is_atp_db && !local.is_db_deleted ? 1 : 0
5656
template = length(data.oci_database_autonomous_database.atp_db[0].nsg_ids) > 0 ? data.oci_database_autonomous_database.atp_db[0].nsg_ids[0] : ""
5757
}
5858

@@ -76,6 +76,6 @@ data "oci_database_database" "ocidb_database" {
7676
}
7777

7878
data "oci_database_db_home" "ocidb_db_home" {
79-
count = local.is_ocidb_system_id_available ? 1 : 0
79+
count = local.is_ocidb_system_id_available && !local.is_db_deleted ? 1 : 0
8080
db_home_id = data.oci_database_database.ocidb_database[0].db_home_id
8181
}

terraform/modules/compute/wls_compute/locals.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ locals {
2828
db_options = try(lookup(data.oci_database_db_systems.ocidb_db_systems[0].db_systems[0], "db_system_options", []), [])
2929
db_storage_management = try(lookup(local.db_options[0], "storage_management", "ASM"), "ASM")
3030

31+
is_db_deleted = local.apply_JRF ? (local.is_atp_db ? (data.oci_database_autonomous_database.atp_db[0].id == null ? true : false) : (data.oci_database_database.ocidb_database[0].id == null ? true : false)) : false
32+
3133
}

terraform/modules/compute/wls_compute/wls_compute.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ module "wls-instances" {
153153
atp_db_level = var.jrf_parameters.atp_db_parameters.atp_db_level
154154
is_atp_dedicated = local.is_atp_db ? lookup(data.oci_database_autonomous_database.atp_db[0], "is_dedicated") : false
155155
atp_private_end_point = element(coalescelist(data.oci_database_autonomous_database.atp_db.*.private_endpoint, [""]), 0)
156-
atp_nsg_id = local.is_atp_db ? data.template_file.atp_nsg_id[0].rendered : ""
156+
atp_nsg_id = local.is_atp_db && !local.is_db_deleted ? data.template_file.atp_nsg_id[0].rendered : ""
157157

158158
# TODO: These variables are hardcoded to allow creating instances without app db. Remove them once app db code is removed from image
159159
is_atp_app_db = "false"

0 commit comments

Comments
 (0)