Skip to content

Commit 445aecc

Browse files
Merge branch 'main' into topic_robesanc_jcs-13162
2 parents 5f764d3 + f476412 commit 445aecc

File tree

11 files changed

+71
-47
lines changed

11 files changed

+71
-47
lines changed

builds/build_mp_bundles.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ replace_byol_suite_14110_variables()
301301
}
302302
replace_ucm_suite_12214_variables()
303303
{
304-
export TF_VAR_FILE=${SCRIPT_DIR}/../terraform/inputs/mp_image_suite_byol.tfvars
304+
export TF_VAR_FILE=${SCRIPT_DIR}/../terraform/inputs/mp_image_suite_ucm.tfvars
305305
get_mp_values
306306
sed -i '/variable "tf_script_version" {/!b;n;n;n;cdefault = '"$tf_script_version"'' ${TMP_BUILD}/variables.tf
307307
sed -i 's/default = "EE"/default = "SUITE"/' ${TMP_BUILD}/edition.tf
@@ -314,7 +314,7 @@ replace_ucm_suite_12214_variables()
314314
}
315315
replace_ucm_suite_14110_variables()
316316
{
317-
export TF_VAR_FILE=${SCRIPT_DIR}/../terraform/inputs/mp_image_suite_byol.tfvars
317+
export TF_VAR_FILE=${SCRIPT_DIR}/../terraform/inputs/mp_image_suite_ucm.tfvars
318318
get_mp_values
319319
sed -i '/variable "tf_script_version" {/!b;n;n;n;cdefault = '"$tf_script_version"'' ${TMP_BUILD}/variables.tf
320320
sed -i 's/default = "EE"/default = "SUITE"/' ${TMP_BUILD}/edition.tf

terraform/data_sources.tf

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,14 @@ data "oci_file_storage_mount_targets" "mount_targets" {
116116
id = var.mount_target_id
117117
}
118118

119-
120-
data "oci_file_storage_mount_targets" "existing_mount_target" {
121-
count = var.existing_fss_id != "" ? 1 : 0
122-
#Required
123-
availability_domain = local.fss_availability_domain
124-
compartment_id = var.mount_target_compartment_id
125-
id = var.mount_target_id
126-
}
127-
128119
data "oci_core_private_ip" "mount_target_private_ips" {
129120
count = var.existing_fss_id != "" ? 1 : 0
130121
#Required
131-
private_ip_id = data.oci_file_storage_mount_targets.existing_mount_target[0].mount_targets[0].private_ip_ids[0]
122+
private_ip_id = data.oci_file_storage_mount_targets.mount_targets[0].mount_targets[0].private_ip_ids[0]
132123
}
133124

134125
data "oci_apm_apm_domain" "apm_domain" {
135-
count = var.use_apm_service ? 1 : 0
126+
count = local.use_apm_service ? 1 : 0
136127

137128
#Required
138129
apm_domain_id = var.apm_domain_id
@@ -151,13 +142,6 @@ data "oci_core_subnet" "mount_target_existing_subnet" {
151142
subnet_id = data.oci_file_storage_mount_targets.mount_targets[0].mount_targets[0].subnet_id
152143
}
153144

154-
data "oci_core_subnet" "mount_target_existing_subnet_by_fss" {
155-
count = var.existing_fss_id == "" ? 0 : 1
156-
157-
#Required
158-
subnet_id = data.oci_file_storage_mount_targets.existing_mount_target[0].mount_targets[0].subnet_id
159-
}
160-
161145
data "oci_objectstorage_namespace" "object_namespace" {
162146

163147
#Optional

terraform/locals.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,16 @@ locals {
9090

9191
assign_weblogic_public_ip = var.assign_weblogic_public_ip || var.subnet_type == "Use Public Subnet"
9292

93+
// Deploy sample-app only if the edition is not SE
94+
deploy_sample_app = (var.deploy_sample_app && var.wls_edition != "SE")
95+
9396
admin_ip_address = local.assign_weblogic_public_ip ? module.compute.instance_public_ips[0] : module.compute.instance_private_ips[0]
9497
admin_console_app_url = format("https://%s:%s/console", local.admin_ip_address, var.wls_extern_ssl_admin_port)
9598
sample_app_protocol = local.add_load_balancer ? "https" : "http"
96-
sample_app_url_lb_ip = var.deploy_sample_app && local.add_load_balancer ? format("%s://%s/sample-app", local.sample_app_protocol, local.lb_ip) : ""
97-
sample_app_url_wls_ip = var.deploy_sample_app ? format("https://%s:%s/sample-app", local.admin_ip_address, var.wls_ms_extern_ssl_port) : ""
98-
sample_app_url = var.wls_edition != "SE" ? (var.deploy_sample_app && local.add_load_balancer ? local.sample_app_url_lb_ip : local.sample_app_url_wls_ip) : ""
99-
sample_idcs_app_url = var.deploy_sample_app && local.add_load_balancer && var.is_idcs_selected ? format(
99+
sample_app_url_lb_ip = local.deploy_sample_app && local.add_load_balancer ? format("%s://%s/sample-app", local.sample_app_protocol, local.lb_ip) : ""
100+
sample_app_url_wls_ip = local.deploy_sample_app ? format("https://%s:%s/sample-app", local.admin_ip_address, var.wls_ms_extern_ssl_port) : ""
101+
sample_app_url = local.deploy_sample_app ? (local.add_load_balancer ? local.sample_app_url_lb_ip : local.sample_app_url_wls_ip) : ""
102+
sample_idcs_app_url = local.deploy_sample_app && local.add_load_balancer && var.is_idcs_selected ? format(
100103
"%s://%s/__protected/idcs-sample-app",
101104
local.sample_app_protocol,
102105
local.lb_ip,
@@ -145,7 +148,10 @@ locals {
145148
var.wls_extern_ssl_admin_port,
146149
) : ""
147150

148-
apm_domain_compartment_id = var.use_apm_service ? lookup(data.oci_apm_apm_domain.apm_domain[0], "compartment_id") : ""
151+
use_apm_service = (var.use_apm_service || var.use_autoscaling)
152+
apm_domain_compartment_id = local.use_apm_service ? lookup(data.oci_apm_apm_domain.apm_domain[0], "compartment_id") : ""
153+
154+
149155

150156
ocir_namespace = data.oci_objectstorage_namespace.object_namespace.namespace
151157

terraform/main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ module "policies" {
204204
is_idcs_selected = var.is_idcs_selected
205205
idcs_client_secret_id = var.idcs_client_secret_id
206206
use_oci_logging = var.use_oci_logging
207-
use_apm_service = var.use_apm_service
207+
use_apm_service = local.use_apm_service
208208
apm_domain_compartment_id = local.apm_domain_compartment_id
209209
use_autoscaling = var.use_autoscaling
210210
ocir_auth_token_id = var.ocir_auth_token_id
@@ -403,7 +403,7 @@ module "validators" {
403403
use_oci_logging = var.use_oci_logging
404404
dynamic_group_id = var.dynamic_group_id
405405

406-
use_apm_service = var.use_apm_service
406+
use_apm_service = local.use_apm_service
407407
apm_domain_id = var.apm_domain_id
408408
apm_private_data_key_name = var.apm_private_data_key_name
409409

@@ -558,14 +558,16 @@ module "compute" {
558558
wls_domain_name = format("%s_domain", local.service_name_prefix)
559559
wls_server_startup_args = var.wls_server_startup_args
560560
wls_existing_vcn_id = var.wls_existing_vcn_id
561-
mount_vcn_id = var.mount_target_id != "" ? data.oci_core_subnet.mount_target_existing_subnet[0].vcn_id : (var.existing_fss_id != "" ? data.oci_core_subnet.mount_target_existing_subnet_by_fss[0].vcn_id : "")
561+
mount_vcn_id = var.mount_target_id != "" ? data.oci_core_subnet.mount_target_existing_subnet[0].vcn_id : ""
562562
wls_vcn_cidr = var.wls_vcn_cidr != "" ? var.wls_vcn_cidr : element(concat(module.network-vcn.*.vcn_cidr, tolist([""])), 0)
563563
wls_version = var.wls_version
564564
wls_edition = var.wls_edition
565565
allow_manual_domain_extension = var.allow_manual_domain_extension
566566
num_vm_instances = var.wls_node_count
567567
resource_name_prefix = var.service_name
568568

569+
deploy_sample_app = local.deploy_sample_app
570+
569571
is_bastion_instance_required = var.is_bastion_instance_required
570572

571573
is_idcs_selected = var.is_idcs_selected
@@ -610,7 +612,7 @@ module "compute" {
610612
log_group_id = element(concat(module.observability-common[*].log_group_id, [""]), 0)
611613
use_oci_logging = var.use_oci_logging
612614

613-
use_apm_service = var.use_apm_service
615+
use_apm_service = local.use_apm_service
614616
apm_domain_compartment_id = local.apm_domain_compartment_id
615617
apm_domain_id = var.apm_domain_id
616618
apm_private_data_key_name = var.apm_private_data_key_name

terraform/modules/observability/autoscaling/local.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ locals {
2121
function_config_map = zipmap(
2222
["min_wls_node_count", "wlsc_email_notification_topic_id", "debug", "offline_ms1_from_lb"],
2323
[var.wls_node_count,
24-
(var.subscription_endpoint != "" ? element(concat(oci_ons_notification_topic.wlsc_email_notification_topic.*.id, list("")), 0) : ""),
24+
(var.subscription_endpoint != "" ? element(concat(oci_ons_notification_topic.wlsc_email_notification_topic.*.id, tolist([""])), 0) : ""),
2525
"false",
2626
"false"
2727
])

terraform/modules/policies/locals.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ locals {
1313

1414
# This policy with "use instances" verb is needed because there is code in the WebLogic for OCI compute image that updates metadata of the compute instance, when more than one VM nodes are created
1515
core_policy_statement1 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to use instances in compartment id ${var.compartment_id}"
16-
core_policy_statement2 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to inspect volumes in compartment id ${var.compartment_id}"
17-
core_policy_statement3 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to inspect volume-attachments in compartment id ${var.compartment_id}"
16+
core_policy_statement2 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to manage volumes in compartment id ${var.compartment_id}"
17+
core_policy_statement3 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to manage volume-attachments in compartment id ${var.compartment_id}"
1818
# This policy with "inspect virtual-network-family" verb is needed to read VCN information like CIDR, etc, for VCN validation
1919
network_policy_statement1 = var.network_compartment_id != "" ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to inspect virtual-network-family in compartment id ${var.network_compartment_id}" : ""
2020
secrets_policy_statement1 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read secret-bundles in tenancy where target.secret.id = '${var.wls_admin_password_id}'"
2121
secrets_policy_statement2 = (var.is_idcs_selected && var.idcs_client_secret_id != "") ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read secret-bundles in tenancy where target.secret.id = '${var.idcs_client_secret_id}'" : ""
2222
atp_policy_statement1 = (var.atp_db.is_atp && var.atp_db.password_id != "") ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read secret-bundles in tenancy where target.secret.id = '${var.atp_db.password_id}'" : ""
2323
# This policy with "use autonomous-transaction-processing-family" verb is needed to download ATP db wallet
24-
atp_policy_statement2 = (var.atp_db.is_atp && var.atp_db.compartment_id != "") ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to use autonomous-transaction-processing-family in compartment id ${var.atp_db.compartment_id}" : ""
24+
atp_policy_statement2 = (var.atp_db.is_atp && var.atp_db.compartment_id != "") ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to use autonomous-transaction-processing-family in compartment id ${var.atp_db.compartment_id}" : ""
2525
# This policy with "manage network-security-groups" verb is needed to add security rule in the ATP db (with private endpoint) NSG in the ATP db VCN
2626
atp_policy_statement3 = (var.atp_db.is_atp_with_private_endpoints && var.atp_db.existing_vcn_add_seclist && var.atp_db.network_compartment_id != "") ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to manage network-security-groups in compartment id ${var.atp_db.network_compartment_id} where request.operation = 'AddNetworkSecurityGroupSecurityRules'" : ""
2727
oci_db_policy_statement1 = var.oci_db.password_id != "" ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read secret-bundles in tenancy where target.secret.id = '${var.oci_db.password_id}'" : ""
@@ -36,7 +36,10 @@ locals {
3636
# This policy with "use load_balancer" verb is needed to create load balancer for new vcn
3737
lb_policy_statement = var.add_load_balancer ? length(oci_identity_dynamic_group.wlsc_instance_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to use load-balancers in compartment id ${var.network_compartment_id}" : "" : ""
3838

39-
service_statements = compact([local.core_policy_statement1, local.core_policy_statement2, local.core_policy_statement3, local.network_policy_statement1, local.secrets_policy_statement1, local.secrets_policy_statement2, local.atp_policy_statement1, local.atp_policy_statement2, local.atp_policy_statement3, local.oci_db_policy_statement1, local.oci_db_policy_statement2, local.logging_policy, local.apm_domain_policy_statement, local.lb_policy_statement])
39+
service_statements = compact([local.core_policy_statement1, local.core_policy_statement2, local.core_policy_statement3, local.network_policy_statement1, local.secrets_policy_statement1, local.secrets_policy_statement2,
40+
local.atp_policy_statement1, local.atp_policy_statement2, local.atp_policy_statement3, local.oci_db_policy_statement1, local.oci_db_policy_statement2, local.oci_db_policy_statement3, local.logging_policy,
41+
local.apm_domain_policy_statement, local.lb_policy_statement
42+
])
4043

4144
cloning_policy_statement1 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read orm-stacks in compartment id ${var.compartment_id}"
4245
cloning_policy_statement2 = "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to inspect compartments in tenancy"

terraform/modules/validators/existing_load_balancer_validators.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ locals {
1010
validate_existing_lb_must_use_existing_subnets = local.use_existing_load_balancer && !var.use_existing_subnets ? local.validators_msg_map[local.existing_lb_must_use_existing_subnets_msg] : null
1111

1212
lb_subnet_1_id_from_datasource = [for subnet in data.oci_core_subnets.existing_vcn_subnets_data_source.subnets[*] : subnet.id if subnet.id == var.existing_lb_subnet_1_id]
13-
# set to true if lb subnet_1 is present in the list of subnet for the existing vcn of the stack
14-
valid_existing_lb_subnet_1 = local.use_existing_load_balancer && local.lb_subnet_1_id_from_datasource != "" ? local.lb_subnet_1_id_from_datasource != "" : false
13+
# set to true if lb subnet_1 is present in the list of subnet for the existing vcn of the stack or if not using existing load balancer
14+
valid_existing_lb_subnet_1 = local.use_existing_load_balancer ? length(local.lb_subnet_1_id_from_datasource) != 0 : true
1515

1616
existing_lb_subnet_1_not_in_existing_vcn_of_stack_msg = "WLSC-ERROR: The load balancer [${var.existing_load_balancer_id}] subnet_1 [${var.existing_lb_subnet_1_id}] is not in the the existing vcn [${var.existing_vcn_id}] for the stack"
1717
validate_existing_lb_vcn_subnet_1 = local.use_existing_load_balancer && !local.valid_existing_lb_subnet_1 ? local.validators_msg_map[local.existing_lb_subnet_1_not_in_existing_vcn_of_stack_msg] : null
1818

1919
lb_subnet_2_id_from_datasource = [for subnet in data.oci_core_subnets.existing_vcn_subnets_data_source.subnets[*] : subnet.id if subnet.id == var.existing_lb_subnet_2_id]
20-
# set to true if lb subnet_2 is present in the list of subnet for the existing vcn of the stack
21-
valid_existing_lb_subnet_2 = local.use_existing_load_balancer && local.lb_subnet_2_id_from_datasource != "" ? local.lb_subnet_2_id_from_datasource != "" : false
20+
# set to true if lb subnet_2 is present in the list of subnet for the existing vcn of the stack, or if is empty (for regional lb), or if not using existing load balancer
21+
valid_existing_lb_subnet_2 = var.existing_lb_subnet_2_id == "" ? true : local.use_existing_load_balancer ? length(local.lb_subnet_2_id_from_datasource) != 0 : true
2222

23-
existing_lb_subnet_2_not_in_existing_vcn_of_stack_msg = "WLSC-ERROR: The load balancer [${var.existing_load_balancer_id}] subnet_2 [${var.existing_lb_subnet_2_id}] is not in the the existing vcn [${var.existing_vcn_id}] for the stack"
23+
existing_lb_subnet_2_not_in_existing_vcn_of_stack_msg = "WLSC-ERROR: The load balancer [${var.existing_load_balancer_id}] subnet_2 [${var.existing_lb_subnet_2_id}] is not in the existing vcn [${var.existing_vcn_id}] for the stack"
2424
validate_existing_lb_vcn_subnet_2 = local.use_existing_load_balancer && !local.valid_existing_lb_subnet_2 ? local.validators_msg_map[local.existing_lb_subnet_2_not_in_existing_vcn_of_stack_msg] : null
2525

2626
# verify that the backend set name is non-empty

terraform/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ output "fss_system_id" {
1818
}
1919

2020
output "mount_target_id" {
21-
value = var.mount_target_id != "" ? var.mount_target_id : var.existing_fss_id != "" ? data.oci_file_storage_mount_targets.existing_mount_target[0].mount_targets[0].id : (var.add_fss ? module.fss[0].mount_target_id : "")
21+
value = var.add_fss? (var.mount_target_id != ""? var.mount_target_id: module.fss[0].mount_target_id):""
2222
}
2323

2424
output "load_balancer_id" {

terraform/schema.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,12 +1177,11 @@ variables:
11771177
- eq:
11781178
- ${load_balancer_strategy_existing_subnet}
11791179
- "Use Existing Load Balancer"
1180-
type: oci:loadbalancer:loadbalancer:id
1180+
type: string
1181+
pattern: ^ocid1.loadbalancer.*$
11811182
title: Existing Load Balancer ID
11821183
description: The OCID of the existing load balancer. If you use an existing load balancer, the WebLogic Server nodes are added to the backend set of the existing load balancer.
11831184
required: true
1184-
dependsOn:
1185-
compartmentId: ${network_compartment_id}
11861185

11871186
backendset_name_for_existing_load_balancer:
11881187
visible:

terraform/schema_14110.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,12 +1186,11 @@ variables:
11861186
- eq:
11871187
- ${load_balancer_strategy_existing_subnet}
11881188
- "Use Existing Load Balancer"
1189-
type: oci:loadbalancer:loadbalancer:id
1189+
type: string
1190+
pattern: ^ocid1.loadbalancer.*$
11901191
title: Existing Load Balancer ID
11911192
description: The OCID of the existing load balancer. If you use an existing load balancer, the WebLogic Server nodes are added to the backend set of the existing load balancer.
11921193
required: true
1193-
dependsOn:
1194-
compartmentId: ${network_compartment_id}
11951194

11961195
backendset_name_for_existing_load_balancer:
11971196
visible:

0 commit comments

Comments
 (0)