Skip to content

Commit 7132920

Browse files
authored
Development (#155)
Update development to main branch
2 parents f965544 + 4f484f6 commit 7132920

15 files changed

+645
-237
lines changed

README.md

Lines changed: 265 additions & 190 deletions
Large diffs are not rendered by default.

VARIABLES.md

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Variables
2+
3+
The variables you define for the stack determine the resources that will be provisioned. Some variables are optional, but
4+
some are required. This document lists the different components for which you can specify variables to change the resources
5+
created with the stack, and the files that contain those variables.
6+
7+
*NOTE:* There are some variables that have a comment like `Variable used in UI only`. You should not set values for those
8+
variables.
9+
10+
## OCI and Service
11+
12+
These variables are required because they indicate, among other things:
13+
- The tenancy and region where the stack and its resources are created
14+
- The user creating the resources
15+
- The compartment where the resources are created
16+
17+
For example:
18+
```terraform
19+
user_id = "ocid1.user.xxxxxxxxxxxxxx"
20+
fingerprint = "<fingerprint>"
21+
private_key_path = "~/.oci/oci_api_key_prod.pem"
22+
23+
tenancy_ocid = "ocid1.tenancy.xxxxxxxxxxxxxxxxxx"
24+
region = "us-ashburn-1"
25+
compartment_ocid = "ocid1.compartment.xxxxxxxxxxxxxxxx"
26+
service_name = "test"
27+
```
28+
Review the [variables.tf](./terraform/variables.tf) file for more details.
29+
30+
## Network Variables
31+
32+
You can create a new VCN for your stack, or you can use an existing VCN, but create new subnets, or you can use existing
33+
subnets for your stack. If you use existing subnets, you can use security lists to control network traffic between resources
34+
of the stack, or you can use network security groups (NSG). To use one of these options, you use variables from the
35+
[network_variables.tf](./terraform/network_variables.tf) file.
36+
37+
If you want to create a new VCN, you can set these variables:
38+
```terraform
39+
# Specify a compartment different from the stack compartment to create all network resources
40+
network_compartment_id = "ocid1.compartment.xxxxxxxxxxxxxx"
41+
wls_vcn_name = "myvcn"
42+
#CIDR of the new VCN and subnets for different resources
43+
wls_vcn_cidr = "10.0.0.0/16"
44+
wls_subnet_cidr = "10.0.2.0/24"
45+
#Required if you add a load balancer
46+
lb_subnet_1_cidr = "10.0.3.0/24"
47+
#Required if you add a file system and new mount target
48+
mount_target_subnet_cidr = "10.0.4.0/24"
49+
#Required if you add a bastion
50+
bastion_subnet_cidr = "10.0.1.0/24"
51+
```
52+
53+
If you want to use an existing VCN and subnets, you can set these variables:
54+
```terraform
55+
# Specify a compartment different from the stack compartment to create all network resources
56+
network_compartment_id = "ocid1.compartment.xxxxxxxxxxxxxx"
57+
# Use this if the existng subnets to use are AD-specific
58+
#use_regional_subnet = false
59+
wls_existing_vcn_id = "ocid1.vcn.xxxxxxxxxxxxxxx"
60+
wls_subnet_id = "ocid1.subnet.xxxxxxxxxxxxxxx"
61+
#Required if you add a load balancer
62+
lb_subnet_1_id = "ocid1.subnet.xxxxxxxxxxxxxxx"
63+
#Required only if using AD-specific subnets
64+
#lb_subnet_2_id = "ocid1.subnet.xxxxxxxxxxxxxxx"
65+
#Required if you add a file system and new mount target
66+
mount_target_subnet_id = "ocid1.subnet.xxxxxxxxxxxxxxx"
67+
#Required if you add a bastion
68+
bastion_subnet_id = "ocid1.subnet.xxxxxxxxxxxxxxx"
69+
```
70+
71+
## WebLogic Domain
72+
73+
The variables that determine the way your WebLogic domain will be created are in the [weblogic_variables.tf](./terraform/weblogic_variables.tf)
74+
file.
75+
76+
For example, to create a WebLogic 14c domain with JDK 11 and two managed servers, you can specify the following:
77+
```terraform
78+
wls_admin_user = "weblogic"
79+
wls_admin_password_id = "ocid1.vaultsecret.xxxxxxxxxxxxxxx"
80+
wls_version = "14.1.1.0"
81+
wls_14c_jdk_version = "jdk11"
82+
wls_node_count = 2
83+
```
84+
85+
If you want to create a JRF domain, you need to specify variables for a database, either ATP or OCI DB. See the [Database](#database)
86+
section for more details.
87+
88+
## Database
89+
90+
If you want to create a WebLogic JRF domain, you must specify the details of a database. The supported databases are ATP
91+
and OCI DB.
92+
93+
If you want to use an ATP database to create a JRF domain you can use the following variables:
94+
```terraform
95+
atp_db_id = "ocid1.autonomousdatabase.oc1.xxxxxxxxxxxxxxx"
96+
atp_db_password_id = "ocid1.vaultsecret.oc1.xxxxxxxxxxxxxxx"
97+
atp_db_compartment_id = "ocid1.compartment.oc1..xxxxxxxxxxxxxxx"
98+
atp_db_level = "tp"
99+
100+
# In case your ATP DB uses private endpoint
101+
# atp_db_existing_vcn_id = "ocid1.vcn.oc1.atp_db_level"
102+
103+
# In case VCN peering is needed
104+
#db_vcn_lpg_id = "ocid1.localpeeringgateway.oc1.atp_db_level"
105+
```
106+
If you want to use an OCi DB database to create a JRF domain you can use the following variables:
107+
```terraform
108+
oci_db_compartment_id = "ocid1.compartment.xxxxxxxxxxxxxxx"
109+
oci_db_dbsystem_id = "ocid1.dbsystem.xxxxxxxxxxxxxxx"
110+
oci_db_database_id = "ocid1.database.xxxxxxxxxxxxxxx"
111+
oci_db_pdb_service_name = "<oci_db_pdb_service_name>"
112+
oci_db_user = "SYS"
113+
oci_db_password_id = "ocid1.vaultsecret.xxxxxxxxxxxxxxx"
114+
oci_db_network_compartment_id = "ocid1.compartment.xxxxxxxxxxxxxxx"
115+
oci_db_existing_vcn_id = "ocid1.vcn.xxxxxxxxxxxxxxxa"
116+
db_existing_vcn_add_secrule = true
117+
118+
# In case VCN peering is needed
119+
#db_vcn_lpg_id = "ocid1.localpeeringgateway.oc1.atp_db_level"
120+
```
121+
Review the [db_variables.tf](./terraform/db_variables.tf) file for more details.
122+
123+
## WebLogic Compute Instance
124+
125+
To specify shape and OCPUs (for flex shapes) for the WebLogic VMs, you can set variables from the [variables.tf](./terraform/variables.tf) file.
126+
127+
For example:
128+
```terraform
129+
instance_shape = "VM.Standard.E4.Flex"
130+
wls_ocpu_count = 1
131+
# By default, the first WebLogic VM is placed in the first AD, but you can change that behavior with this variable
132+
wls_availability_domain_name = "<availability domain name>"
133+
```
134+
135+
## Bastion
136+
137+
To customize the bastion instance creation (which is enabled by default), use an existing bastion, or disable the use of
138+
a bastion instance, you can set the variables in the [bastion_variables.tf](./terraform/bastion_variables.tf) file.
139+
140+
For example, to create a new bastion with a reserved public IP, with a VM shape different from the default, set these variables:
141+
```terraform
142+
is_bastion_instance_required = true
143+
bastion_instance_shape = "VM.Standard2.1"
144+
is_bastion_with_reserved_public_ip = true
145+
```
146+
147+
## Load Balancer Variables
148+
149+
To add a load balancer to distribute traffic to the servers of the WebLogic domain, use the variables in the
150+
[network_variables.tf](./terraform/network_variables.tf) file.
151+
152+
For example, to add a new load balancer to your stack, you can use these variables:
153+
```terraform
154+
add_load_balancer = true
155+
# Use this if you are creating new subnets
156+
lb_subnet_1_cidr = "10.0.3.0/24"
157+
# Use this if you are using existing subnets
158+
#lb_subnet_1_id = "ocid1.subnet.xxxxxxxxxxxxxxx"
159+
lb_min_bandwidth = 10
160+
lb_max_bandwidth = 100
161+
```
162+
163+
## IDCS
164+
165+
In order to use IDCS for user authentication in your WebLogic applications, you can set the variables described in the [idcs_variables.tf](./terraform/idcs_variables.tf) file.
166+
167+
This is an example:
168+
```terraform
169+
is_idcs_selected = true
170+
idcs_host = "identity.oraclecloud.com"
171+
idcs_tenant = "idcs-xxxxxxxxxxxxxxx"
172+
idcs_client_id = "<idcs_client_id>"
173+
idcs_client_secret_id = "ocid1.vaultsecret.xxxxxxxxxxxxxxx"
174+
```
175+
There are some prerequisites for using IDCS. See the `Create a Confidential Application`section in the
176+
[documentation](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/you-begin-oracle-weblogic-cloud.html).
177+
178+
## File system
179+
180+
To create a file system and mount to the WebLogic VMs of your stack, refer to the [fss_variables.tf](./terraform/fss_variables.tf)
181+
file for the variables to use.
182+
183+
This is an example of how to create new file system and mount target:
184+
```terraform
185+
add_fss = true
186+
fss_availability_domain = "<availability domain name>"
187+
```
188+
189+
## Observability
190+
191+
You can configure OCI logging to send WebLogic logs to an OCI log. You can also enable APM support to push WebLogic server
192+
metrics to an APM domain.
193+
194+
This is an example of how to configure both OCI logging and APM support:
195+
```terraform
196+
use_oci_logging = true
197+
use_apm_service = true
198+
apm_domain_id = "ocid1.apmdomain.oc1.phx.xxxxxxxxxxxxxxx"
199+
```
200+
Review the [observability_variables.tf](./terraform/observability_variables.tf) file for more details.
201+
202+
## Autoscaling
203+
To configure the stack to automatically add or remove servers based on performance metrics, refer to the
204+
[autoscaling_variables.tf](./terraform/autoscaling_variables.tf) file for the variables to use.
205+
206+
Note that autoscaling is not supported when creating a stack using Terraform CLI. You need you create a [Resource Manager][orm]
207+
stack, or use the [Marketplace][marketplace].
208+
209+
[marketplace]: https://docs.oracle.com/iaas/Content/Marketplace/Concepts/marketoverview.htm
210+
[orm]: https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm

solutions/common/mp_byol.tfvars

Lines changed: 0 additions & 12 deletions
This file was deleted.

solutions/jrf/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## WebLogic JRF domain with OCI DB
2+
3+
This solution creates single/multi node Weblogic cluster with OCI Database and Oracle Identity Cloud Service fronted by a load balancer. The solution will create only one stack at time and further modifications that are done will be done on the same stack.
4+
5+
This topology uses existing infrastructure.
6+
- Existing VCN and existing subnets with private WebLogic subnet.
7+
- OCI DB in a different VCN
8+
- Existing public load balancer
9+
10+
Oracle Identity Cloud Service (IDCS) is used to authenticate user.
11+
12+
![Full Topology Diagram](Topology.png)
13+
14+
The above diagram shows a topology that includes most of the components supported by the Terraform scripts.
15+
In this scenario, the WebLogic servers are in a private subnet. To access the applications running on WebLogic, an existing OCI load balancer in public regional subnet is used. A bastion instance with a public IP address is provisioned to allow access to the VMs in the private subnet. The Oracle WebLogic Server domain is configured to use Oracle Identity Cloud Service for authentication.
16+
17+
The diagram shows the stack using a database located in a VCN different from the one used by the WebLogic for OCI stack, with VCN peering. Peering is necessary because DB VCN is different from Weblogic VCN. Since existing VCNs are used here, VCNs for WebLogic Server compute instances and the Oracle Cloud Infrastructure Application Database are peered manually before creating the stack for the Oracle WebLogic Server for OCI domain. To peer the VCNs manually, see [Manual VCN Peering](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/configure-database-parameters.html#GUID-6A39A2A7-EF6C-408E-B5C7-C44089A9B134__MANUAL_VCN_PEERING).
18+
19+
## Before You Begin with Oracle WebLogic Server for OCI
20+
Refer to the [documentation](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/you-begin-oracle-weblogic-cloud.html) for the pre-requisite steps to using Oracle WebLogic Server for OCI.
21+
22+
## Workspace Checkout
23+
- Install latest version of git from http://git-scm.com/downloads
24+
- For Linux and Mac: Add the git to the PATH
25+
- Clone the code using the command:
26+
27+
```bash
28+
git clone https://github.com/oracle-quickstart/weblogic-server-for-oci.git
29+
```
30+
31+
## Organization
32+
The directory weblogic-server-for-oci/solutions/jrf consists of the following terraform files:
33+
34+
- jrf_instance.tfvars - WebLogic instance, bastion instance and network configuration
35+
- existing_lb.tfvars - Load balancer configuration
36+
- oci_db.tfvars - OCI Database configuration
37+
- idcs.tfvars - IDCS configuration
38+
39+
The directory weblogic-server-for-oci/solutions/common consists of the following:
40+
- tenancy.tfvars - tenancy configuration
41+
42+
## Using the Terraform command line tool
43+
```bash
44+
cd weblogic-server-for-oci/terraform
45+
```
46+
47+
Initialize the terraform provider plugin
48+
```bash
49+
terraform init
50+
```
51+
52+
Update the variable values in tfvars files under directories terraform/solutions/common and terraform/solutions/jrf according to the user specific values
53+
Invoke apply passing all *.tfvars files as input
54+
```bash
55+
terraform apply -var-file=../solutions/common/tenancy.tfvars -var-file=inputs/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
56+
```
57+
58+
To destroy the infrastructure
59+
```bash
60+
terraform destroy var-file=../solutions/common/tenancy.tfvars -var-file=inputs/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
61+
```
62+
**Important:** Refer to [documentation](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/delete-domain.html) for steps to perform before running *terraform destroy*.

solutions/jrf/Topology.png

138 KB
Loading

solutions/non_jrf/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## WebLogic non JRF domain
2+
3+
This solution creates single/multi node WebLogic cluster with Oracle Cloud Infrastructure File Storage service (FSS) fronted
4+
by a load balancer. The solution will create only one stack at time and further modifications that are done will be
5+
done on the same stack.
6+
7+
This topology creates WebLogic cluster in private subnet. Following regional subnets are created under new virtual cloud network (VCN).
8+
- WebLogic regional private subnet
9+
- Bastion regional public subnet
10+
- Load balancer frontend public subnet
11+
- Mount target regional private subnet
12+
13+
![Full Topology Diagram](Topology.png)
14+
15+
The above diagram shows a topology that includes most of the components supported by the Terraform scripts.
16+
In this scenario, the WebLogic servers are created in a private subnet. To access the applications running on WebLogic, a new OCI load balancer in public regional subnet will be created. A bastion instance with a public ip address is provisioned to allow access to the WebLogic VMs in the private subnet. New file system (FSS) and mount target will be created in a private subnet to support mounting shared storage for WebLogic instance data and middleware. The file system (FSS) will be mounted on each WebLoogic instance at /u01/shared.
17+
18+
## Before You Begin with Oracle WebLogic Server for OCI
19+
Refer to the [documentation](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/you-begin-oracle-weblogic-cloud.html) for the pre-requisite steps to using Oracle WebLogic Server for OCI.
20+
21+
## Workspace Checkout
22+
- Install latest version of git from http://git-scm.com/downloads
23+
- For Linux and Mac: Add the git to the PATH
24+
- Clone the code using the command:
25+
26+
```bash
27+
git clone https://github.com/oracle-quickstart/weblogic-server-for-oci.git
28+
```
29+
30+
## Organization
31+
The directory weblogic-server-for-oci/solutions/non_jrf  consists of the following terraform files:
32+
33+
- nonjrf_instance.tfvars - WebLoogic instance, bastion instance , and network configuration
34+
- lb.tfvars - load balancer configuration
35+
- fss.tfvars  - file system configuration
36+
37+
The directory weblogic-server-for-oci/solutions/common  consists of the following:
38+
- tenancy.tfvars - tenancy configuration
39+
40+
## Using the terraform command line tool
41+
```bash
42+
cd weblogic-server-for-oci/terraform
43+
```
44+
45+
Initialize the terraform provider plugin
46+
```bash
47+
terraform init
48+
```
49+
50+
Update the variable values in tfvars files under directories terraform/solutions/common and terraform/solutions/non_jrf according to the user specific values
51+
Invoke apply passing all *.tfvars files as input
52+
```bash
53+
terraform apply -var-file=../solutions/common/tenancy.tfvars -var-file=inputs/mp_image_ee_byol.tfvars -var-file=../solutions/non_jrf/nonjrf_instance.tfvars -var-file=../solutions/non_jrf /lb.tfvars -var-file=../solutions/non_jrf/fss.tfvars
54+
```
55+
56+
To destroy the infrastructure
57+
```bash
58+
terraform destroy -var-file=../solutions/common/tenancy.tfvars -var-file=../solutions/common/mp_byol.tfvars -var-file=../solutions/non_jrf/nonjrf_instance.tfvars -var-file=../solutions/non_jrf/lb.tfvars -var-file=../solutions/non_jrf/fss.tfvars
59+
```
60+
**Important:** Refer to [documentation](https://docs.oracle.com/en/cloud/paas/weblogic-cloud/user/delete-domain.html) for steps to perform before running *terraform destroy*.

solutions/non_jrf/Topology.png

68.4 KB
Loading

solutions/non_jrf/nonjrf_instance.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ instance_shape = "VM.Standard.E4.Flex"
2424
wls_version = "14.1.1.0"
2525
wls_ocpu_count = 1
2626
wls_node_count = 2
27-
wls_availability_domain_name = "HiGv:US-ASHBURN-AD-2"
27+
wls_availability_domain_name = "US-ASHBURN-AD-2"
2828
wls_subnet_cidr = "10.0.2.0/24"
2929

3030
### Bastion parameters to create new bastion instance
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Copyright (c) 2022, Oracle and/or its affiliates.
1+
# Copyright (c) 2022, 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 = "22.4.3-221210030828"
4+
tf_script_version = "23.1.1-230114033856"
55
use_marketplace_image = true
66
listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaawd5ti5ldjzdppppi675onvo3mvjcwt64jjey7rib3beau2ngkl2q"
7-
listing_resource_version = "22.4.3-ol7.9-22.08.29-221210-1"
8-
instance_image_id = "ocid1.image.oc1..aaaaaaaairmksx4f67slubcejqxplq4oszv6dgjzobwou3wdlimns5syraqa"
7+
listing_resource_version = "23.1.1-ol7.9-22.08.29-230114-1"
8+
instance_image_id = "ocid1.image.oc1..aaaaaaaawuaqj4pmipkvjaekwrxt6exfsqbrykbu5nu3u3pffdxilt55ymca"
99

1010
ucm_listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaa653zc2e4fsem5hhwinmfgnv3xp4dmbq6c6gvf45okxf6xz3smhiq"
11-
ucm_listing_resource_version = "22.4.3-ol7.9-22.08.29-221210-1"
12-
ucm_instance_image_id = "ocid1.image.oc1..aaaaaaaawnhnxmnhpeoqgmbyeqmqjjbilbcbfkuayvilzfzciuxbrefkbsza"
11+
ucm_listing_resource_version = "23.1.1-ol7.9-22.08.29-230114-1"
12+
ucm_instance_image_id = "ocid1.image.oc1..aaaaaaaajfiaisyvespfuxbcjcder7bvuafukzp2w5anjeo3nnfccdeywyza"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Copyright (c) 2022, Oracle and/or its affiliates.
1+
# Copyright (c) 2022, 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 = "22.4.3-221210030828"
4+
tf_script_version = "23.1.1-230114033856"
55
use_marketplace_image = true
66
listing_id = "ocid1.appcataloglisting.oc1..aaaaaaaa653zc2e4fsem5hhwinmfgnv3xp4dmbq6c6gvf45okxf6xz3smhiq"
7-
listing_resource_version = "22.4.3-ol7.9-22.08.29-221210-1"
8-
instance_image_id = "ocid1.image.oc1..aaaaaaaawnhnxmnhpeoqgmbyeqmqjjbilbcbfkuayvilzfzciuxbrefkbsza"
7+
listing_resource_version = "23.1.1-ol7.9-22.08.29-230114-1"
8+
instance_image_id = "ocid1.image.oc1..aaaaaaaajfiaisyvespfuxbcjcder7bvuafukzp2w5anjeo3nnfccdeywyza"

0 commit comments

Comments
 (0)