Skip to content

Commit c27ab4b

Browse files
skommalaroberto-sanchez-herreraMahuwa-Barmantelakerachavan
authored
Development (#181)
Merge development branch to main to cut release branch. --------- Co-authored-by: Roberto Sanchez <roberto.s.sanchez@oracle.com> Co-authored-by: Mahuwa Barman <106961326+Mahuwa-Barman@users.noreply.github.com> Co-authored-by: telake <120423380+telake@users.noreply.github.com> Co-authored-by: Rajesh Chavan <120182853+rachavan@users.noreply.github.com> Co-authored-by: abhijit-paranjpe <109541284+abhijit-paranjpe@users.noreply.github.com>
1 parent b98e3bb commit c27ab4b

32 files changed

+956
-612
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ For pre-requisites specific to Terraform CLI and ORM, see their corresponding se
4242

4343
## Create the Stack Using the OCI Marketplace
4444

45+
The WebLogic Server for OCI stack applications available in the Marketplace are:
46+
- [Oracle WebLogic Server Enterprise Edition (UCM)](https://cloudmarketplace.oracle.com/marketplace/en_US/listing/72493372)
47+
- [Oracle WebLogic Suite (UCM)](https://cloudmarketplace.oracle.com/marketplace/en_US/listing/72492657)
48+
- [Oracle WebLogic Server Standard Edition (BYOL)](https://cloudmarketplace.oracle.com/marketplace/en_US/listing/65022652)
49+
- [Oracle WebLogic Server Enterprise Edition (BYOL)](https://cloudmarketplace.oracle.com/marketplace/en_US/listing/63497374)
50+
- [Oracle WebLogic Suite (BYOL)](https://cloudmarketplace.oracle.com/marketplace/en_US/listing/63498586)
51+
4552
To create, manage and destroy the OCI Terraform stack for WebLogic Server as WebLogic Server for OCI using the Marketplace,
4653
follow the instructions in the [documentation](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/create-stack1.html).
4754

VARIABLES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,17 @@ Review the [observability_variables.tf](./terraform/observability_variables.tf)
203203
To configure the stack to automatically add or remove servers based on performance metrics, refer to the
204204
[autoscaling_variables.tf](./terraform/autoscaling_variables.tf) file for the variables to use.
205205

206-
Note that autoscaling is not supported when creating a stack using Terraform CLI. You need you create a [Resource Manager][orm]
206+
This is an example of how to configure autoscaling:
207+
```terraform
208+
use_autoscaling = true
209+
wls_metric = "CPU Load"
210+
min_threshold_percent = 10
211+
max_threshold_percent = 20
212+
ocir_user = "<ocir_user>"
213+
ocir_auth_token_id = "ocid1.vaultsecret.oc1.phx.xxxxxxxxxxxxxxx"
214+
```
215+
There are some prerequisites for using autoscaling. See [documentation](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/components-oracle-weblogic-cloud.html#GUID-CE8B9AE0-0FE9-442A-9239-8B0DFD835119) for more details.
216+
Note that autoscaling is not supported when creating a stack using Terraform CLI. You need to create a [Resource Manager][orm]
207217
stack, or use the [Marketplace][marketplace].
208218

209219
[marketplace]: https://docs.oracle.com/iaas/Content/Marketplace/Concepts/marketoverview.htm

solutions/jrf/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The directory oci-weblogic-server/solutions/jrf consists of the following terraf
4747
The directory oci-weblogic-server/solutions/common consists of the following:
4848
- tenancy.tfvars - tenancy configuration
4949

50-
The files in the oci-weblogic-server/inputs directory contain the values of the images for the different combinations of
50+
The files in the oci-weblogic-server/images directory contain the values of the images for the different combinations of
5151
WebLogic edition and pricing. In this solution, the file _mp_image_ee_byol.tfvars_ is used to create a WebLogic Enterprise
5252
Edition, BYOL instance. Specify a different file to use a different edition and/or pricing.
5353

@@ -63,7 +63,8 @@ Initialize the terraform provider plugin
6363
terraform init
6464
```
6565

66-
Update the variable values in tfvars files under directories terraform/solutions/common and terraform/solutions/jrf according to the user specific values
66+
Update the variable values in tfvars files under directories terraform/solutions/common and terraform/solutions/jrf according
67+
to the user specific values.
6768
Invoke apply passing all *.tfvars files as input
6869
```bash
6970
terraform apply -var-file=../solutions/common/tenancy.tfvars -var-file=images/mp_image_ee_byol.tfvars -var-file=../solutions/jrf/jrf_instance.tfvars -var-file=../solutions/jrf/existing_lb.tfvars -var-file=../solutions/jrf/idcs.tfvars var-file=../solutions/jrf/oci_db.tfvars

solutions/non_jrf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The directory oci-weblogic-server/solutions/non_jrf consists of the following te
4242
The directory oci-weblogic-server/solutions/common consists of the following:
4343
- tenancy.tfvars - tenancy configuration
4444

45-
The files in the oci-weblogic-server/inputs directory contain the values of the images for the different combinations of
45+
The files in the oci-weblogic-server/images directory contain the values of the images for the different combinations of
4646
WebLogic edition and pricing. In this solution, the file _mp_image_ee_byol.tfvars_ is used to create a WebLogic Enterprise
4747
Edition, BYOL instance. Specify a different file to use a different edition and/or pricing.
4848

terraform/bastion_variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ variable "bastion_instance_shape" {
3333

3434
variable "bastion_ssh_private_key" {
3535
type = string
36-
description = "Private ssh key for existing bastion instance"
36+
description = "The path to the file that contains the private ssh key for an existing bastion instance"
3737
default = ""
3838
}
3939

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Copyright (c) 2023, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
33

4-
tf_script_version = "23.1.1-230118062825"
4+
tf_script_version = "23.1.3-230323195128"
55
use_marketplace_image = true
66
listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaawd5ti5ldjzdppppi675onvo3mvjcwt64jjey7rib3beau2ngkl2q"
7-
listing_resource_version = "23.1.1-ol7.9-22.08.29-230118-1"
8-
instance_image_id = "ocid1.image.oc1..aaaaaaaaxr2dllkm3e6qwdleu6q3bwou6pw2r2vt4ne7d7aucrtxpurypvyq"
7+
listing_resource_version = "23.1.3-ol7.9-22.08.29-230323-1"
8+
instance_image_id = "ocid1.image.oc1..aaaaaaaadgqvwsbfcm6bjaowtogdym4kv5gffi6rwv3d5po2o4vk2smwwcxa"
99

1010
ucm_listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaa653zc2e4fsem5hhwinmfgnv3xp4dmbq6c6gvf45okxf6xz3smhiq"
11-
ucm_listing_resource_version = "23.1.1-ol7.9-22.08.29-230118-1"
12-
ucm_instance_image_id = "ocid1.image.oc1..aaaaaaaagrmncsysh64fj5hh5pcjr6swo6oyzzbh4woi4q4hsyct6n5eqkuq"
11+
ucm_listing_resource_version = "23.1.3-ol7.9-22.08.29-230323-1"
12+
ucm_instance_image_id = "ocid1.image.oc1..aaaaaaaagmy46blg6wrvwvozvnui25jxaus5jt6fquv2efkktcf2p6vnveiq"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Copyright (c) 2023, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
33

4-
tf_script_version = "23.1.1-230118062825"
4+
tf_script_version = "23.1.3-230323195128"
55
use_marketplace_image = true
66
listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaa653zc2e4fsem5hhwinmfgnv3xp4dmbq6c6gvf45okxf6xz3smhiq"
7-
listing_resource_version = "23.1.1-ol7.9-22.08.29-230118-1"
8-
instance_image_id = "ocid1.image.oc1..aaaaaaaagrmncsysh64fj5hh5pcjr6swo6oyzzbh4woi4q4hsyct6n5eqkuq"
7+
listing_resource_version = "23.1.3-ol7.9-22.08.29-230323-1"
8+
instance_image_id = "ocid1.image.oc1..aaaaaaaagmy46blg6wrvwvozvnui25jxaus5jt6fquv2efkktcf2p6vnveiq"
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Copyright (c) 2023, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
33

4-
tf_script_version = "23.1.1-230118062825"
4+
tf_script_version = "23.1.3-230323195128"
55
use_marketplace_image = true
66
listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaajl5w3d76x5vdc4n7oqjpsxh4jtwivclvvp6gj4em3kufju6sftga"
7-
listing_resource_version = "23.1.1-ol7.9-22.08.29-230118-1"
8-
instance_image_id = "ocid1.image.oc1..aaaaaaaazc4flvws6yji6ktj6jwzhrm6e6dcvf2vwiokovrlwodvppa5atfa"
7+
listing_resource_version = "23.1.3-ol7.9-22.08.29-230323-1"
8+
instance_image_id = "ocid1.image.oc1..aaaaaaaar3qjebqyaqpqwqzeg2mtf2gt4oosly23qaeb4k76fzhprnphnuxa"
99

1010
ucm_listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaaq2vkow7zwkxg6ky4zxsnckdlfgtgmg7i4kkyev3y6zyo72mpkgza"
11-
ucm_listing_resource_version = "23.1.1-ol7.9-22.08.29-230118-1"
12-
ucm_instance_image_id = "ocid1.image.oc1..aaaaaaaapqar667d3clrw6xgpoccbtqj6rff5xcpj72sstttzqrahvvcx4ia"
11+
ucm_listing_resource_version = "23.1.3-ol7.9-22.08.29-230323-1"
12+
ucm_instance_image_id = "ocid1.image.oc1..aaaaaaaaxrntnjc2btd7o3rig3wpqkyskair2iospvquto2ofjt2tmuuujya"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Copyright (c) 2023, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
33

4-
tf_script_version = "23.1.1-230118062825"
4+
tf_script_version = "23.1.3-230323195128"
55
use_marketplace_image = true
66
listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaaq2vkow7zwkxg6ky4zxsnckdlfgtgmg7i4kkyev3y6zyo72mpkgza"
7-
listing_resource_version = "23.1.1-ol7.9-22.08.29-230118-1"
8-
instance_image_id = "ocid1.image.oc1..aaaaaaaapqar667d3clrw6xgpoccbtqj6rff5xcpj72sstttzqrahvvcx4ia"
7+
listing_resource_version = "23.1.3-ol7.9-22.08.29-230323-1"
8+
instance_image_id = "ocid1.image.oc1..aaaaaaaaxrntnjc2btd7o3rig3wpqkyskair2iospvquto2ofjt2tmuuujya"

terraform/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ locals {
148148
var.wls_extern_ssl_admin_port,
149149
) : ""
150150

151-
use_apm_service = (var.use_apm_service || var.use_autoscaling)
151+
use_apm_service = (var.use_apm_service || var.use_autoscaling)
152152
apm_domain_compartment_id = local.use_apm_service ? lookup(data.oci_apm_apm_domain.apm_domain[0], "compartment_id") : ""
153153

154154

terraform/main.tf

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
# Copyright (c) 2023, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
33

4+
module "network-validation" {
5+
source = "./modules/network-validator"
6+
count = local.use_existing_subnets && !var.skip_network_validation ? 1 : 0
7+
wls_subnet_id = var.wls_subnet_id
8+
bastion_subnet_id = var.is_bastion_instance_required ? var.bastion_subnet_id : ""
9+
bastion_ip = var.is_bastion_instance_required && var.existing_bastion_instance_id != "" ? data.oci_core_instance.existing_bastion_instance[0].private_ip : ""
10+
lb_subnet_1_id = var.add_load_balancer ? var.lb_subnet_1_id : ""
11+
lb_subnet_2_id = var.add_load_balancer && !local.use_regional_subnet ? var.lb_subnet_2_id : ""
12+
mount_target_subnet_id = var.add_fss ? var.mount_target_subnet_id : ""
13+
atp_db_id = !local.is_oci_db ? var.atp_db_id : ""
14+
oci_db_dbsystem_id = local.is_oci_db ? var.oci_db_dbsystem_id : ""
15+
oci_db_port = local.is_oci_db ? var.oci_db_port : 0
16+
wls_extern_admin_port = var.wls_extern_admin_port
17+
wls_extern_ssl_admin_port = var.wls_extern_ssl_admin_port
18+
wls_ms_extern_port = var.wls_ms_extern_port
19+
existing_admin_server_nsg_id = var.add_existing_nsg ? var.existing_admin_server_nsg_id : ""
20+
existing_managed_server_nsg_id = var.add_existing_nsg ? var.existing_managed_server_nsg_id : ""
21+
existing_lb_nsg_id = var.add_existing_nsg && var.add_load_balancer ? var.existing_lb_nsg_id : ""
22+
existing_mount_target_nsg_id = var.add_existing_nsg && var.add_fss ? var.existing_mount_target_nsg_id : ""
23+
existing_bastion_nsg_id = var.add_existing_nsg && var.is_bastion_instance_required ? var.existing_bastion_nsg_id : ""
24+
}
25+
426
module "system-tags" {
27+
depends_on = [module.network-validation]
528
source = "./modules/resource-tags"
629
compartment_id = var.compartment_ocid
730
service_name = var.service_name
@@ -37,14 +60,11 @@ module "network-vcn-config" {
3760
wls_extern_admin_port = var.wls_extern_admin_port
3861
wls_expose_admin_port = var.wls_expose_admin_port
3962
wls_admin_port_source_cidr = var.wls_admin_port_source_cidr
40-
wls_ms_content_port = var.is_idcs_selected ? var.idcs_cloudgate_port : var.wls_ms_extern_ssl_port
63+
wls_ms_content_port = local.add_load_balancer ? (var.is_idcs_selected ? var.idcs_cloudgate_port : var.wls_ms_extern_port) : var.wls_ms_extern_ssl_port
4164
assign_backend_public_ip = local.assign_weblogic_public_ip
4265

43-
wls_security_list_name = !local.assign_weblogic_public_ip ? "bastion-security-list" : "wls-security-list"
4466
wls_subnet_cidr = local.wls_subnet_cidr
4567
wls_ms_source_cidrs = local.add_load_balancer ? [local.lb_subnet_1_subnet_cidr] : ["0.0.0.0/0"]
46-
load_balancer_min_value = local.add_load_balancer ? var.wls_ms_extern_port : var.wls_ms_extern_ssl_port
47-
load_balancer_max_value = local.add_load_balancer ? var.wls_ms_extern_port : var.wls_ms_extern_ssl_port
4868
create_load_balancer = local.add_load_balancer
4969
resource_name_prefix = local.service_name_prefix
5070
bastion_subnet_cidr = local.bastion_subnet_cidr
@@ -183,6 +203,7 @@ module "network-bastion-subnet" {
183203
}
184204

185205
module "policies" {
206+
depends_on = [module.network-validation]
186207
source = "./modules/policies"
187208
count = var.create_policies ? 1 : 0
188209
compartment_id = var.compartment_ocid
@@ -217,6 +238,7 @@ module "policies" {
217238

218239

219240
module "bastion" {
241+
depends_on = [module.network-validation]
220242
source = "./modules/compute/bastion"
221243
count = (!local.assign_weblogic_public_ip && var.is_bastion_instance_required && var.existing_bastion_instance_id == "") ? 1 : 0
222244
availability_domain = local.bastion_availability_domain
@@ -304,6 +326,7 @@ module "network-mount-target-private-subnet" {
304326
}
305327

306328
module "vcn-peering" {
329+
depends_on = [module.network-validation]
307330
count = local.is_vcn_peering ? 1 : 0
308331
source = "./modules/network/vcn-peering"
309332
resource_name_prefix = local.service_name_prefix
@@ -321,7 +344,8 @@ module "vcn-peering" {
321344
}
322345

323346
module "validators" {
324-
source = "./modules/validators"
347+
depends_on = [module.network-validation]
348+
source = "./modules/validators"
325349

326350
service_name = var.service_name
327351
wls_ms_port = var.wls_ms_extern_port
@@ -426,6 +450,7 @@ module "validators" {
426450

427451
wlsoci_vmscripts_zip_bundle_path = var.wlsoci_vmscripts_zip_bundle_path
428452
mode = var.mode
453+
tf_script_version = var.tf_script_version
429454

430455
image_mode = var.image_mode
431456
instance_image_id = var.instance_image_id
@@ -438,8 +463,9 @@ module "validators" {
438463
}
439464

440465
module "fss" {
441-
source = "./modules/fss"
442-
count = var.add_fss ? 1 : 0
466+
depends_on = [module.network-validation]
467+
source = "./modules/fss"
468+
count = var.add_fss ? 1 : 0
443469

444470
compartment_id = var.compartment_ocid
445471
availability_domain = local.fss_availability_domain
@@ -460,8 +486,9 @@ module "fss" {
460486
}
461487

462488
module "load-balancer" {
463-
source = "./modules/lb/loadbalancer"
464-
count = (local.add_load_balancer && var.existing_load_balancer_id == "") ? 1 : 0
489+
depends_on = [module.network-validation]
490+
source = "./modules/lb/loadbalancer"
491+
count = (local.add_load_balancer && var.existing_load_balancer_id == "") ? 1 : 0
465492

466493
compartment_id = local.network_compartment_id
467494
lb_reserved_public_ip_id = compact([var.lb_reserved_public_ip_id])
@@ -480,17 +507,19 @@ module "load-balancer" {
480507
}
481508

482509
module "observability-common" {
483-
source = "./modules/observability/common"
484-
count = var.use_oci_logging ? 1 : 0
510+
depends_on = [module.network-validation]
511+
source = "./modules/observability/common"
512+
count = var.use_oci_logging ? 1 : 0
485513

486514
compartment_id = var.compartment_ocid
487515
service_prefix_name = local.service_name_prefix
488516
add_delay = var.use_autoscaling
489517
}
490518

491519
module "observability-autoscaling" {
492-
source = "./modules/observability/autoscaling"
493-
count = var.use_autoscaling ? 1 : 0
520+
depends_on = [module.network-validation]
521+
source = "./modules/observability/autoscaling"
522+
count = var.use_autoscaling ? 1 : 0
494523

495524
compartment_id = var.compartment_ocid
496525
metric_compartment_id = local.apm_domain_compartment_id
@@ -649,8 +678,9 @@ module "compute" {
649678
}
650679

651680
module "load-balancer-backends" {
652-
source = "./modules/lb/backends"
653-
count = local.add_load_balancer ? 1 : 0
681+
depends_on = [module.network-validation]
682+
source = "./modules/lb/backends"
683+
count = local.add_load_balancer ? 1 : 0
654684

655685
resource_name_prefix = local.service_name_prefix
656686
load_balancer_id = local.add_load_balancer ? (var.existing_load_balancer_id != "" ? var.existing_load_balancer_id : element(coalescelist(module.load-balancer[*].wls_loadbalancer_id, [""]), 0)) : ""
@@ -663,8 +693,9 @@ module "load-balancer-backends" {
663693
}
664694

665695
module "observability-logging" {
666-
source = "./modules/observability/logging"
667-
count = var.use_oci_logging ? 1 : 0
696+
depends_on = [module.network-validation]
697+
source = "./modules/observability/logging"
698+
count = var.use_oci_logging ? 1 : 0
668699

669700
compartment_id = var.compartment_ocid
670701
oci_managed_instances_principal_group = element(concat(module.policies[*].oci_managed_instances_principal_group, [""]), 0)
@@ -680,7 +711,8 @@ module "observability-logging" {
680711
}
681712

682713
module "provisioners" {
683-
source = "./modules/provisioners"
714+
depends_on = [module.network-validation]
715+
source = "./modules/provisioners"
684716

685717
existing_bastion_instance_id = var.existing_bastion_instance_id
686718
host_ips = coalescelist(compact(module.compute.instance_public_ips), compact(module.compute.instance_private_ips), [""])

terraform/modules/compute/wls_compute/wls_compute.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ module "wls-instances" {
7878
log_level = var.log_level
7979
mw_vol_mount_point = lookup(var.volume_map[0], "volume_mount_point")
8080
mw_vol_device = lookup(var.volume_map[0], "device")
81+
mw_volume = module.middleware-volume.data_volume_ids[x / var.num_volumes]
8182
data_vol_mount_point = lookup(var.volume_map[1], "volume_mount_point")
8283
data_vol_device = lookup(var.volume_map[1], "device")
84+
data_volume = module.data-volume.data_volume_ids[x / var.num_volumes]
8385

8486
deploy_sample_app = var.deploy_sample_app
8587
domain_dir = var.domain_dir

terraform/modules/compute/wls_compute/wls_variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ variable "wls_admin_user" {
1515
type = string
1616
description = "The name of the admin user that will be added to the WebLogic domain"
1717
validation {
18-
condition = replace(var.wls_admin_user, "/^[a-zA-Z][a-zA-Z0-9]{7,127}/", "0") == "0"
19-
error_message = "WLSC-ERROR: The value for wls_admin_user provided should be alphanumeric and length should be between 8 and 128 characters."
18+
condition = replace(var.wls_admin_user, "/^[a-zA-Z][a-zA-Z0-9_-]{7,127}/", "0") == "0"
19+
error_message = "WLSC-ERROR: The value for wls_admin_user should be between 8 and 128 characters long and alphanumeric, and can contain underscore (_) and hyphen(-) special characters."
2020
}
2121
}
2222

0 commit comments

Comments
 (0)