Skip to content

Commit df5ba85

Browse files
Merge pull request #124 from oracle-quickstart/topic_robesanc_jcs-13555
JCS-13555 Change to text field for existing LB untile ORM UI bug is f…
2 parents 842b015 + 4d1a895 commit df5ba85

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

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/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)