|
| 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 |
0 commit comments