Invoke Terraform Scripts
Use specific commands to invoke the terraform scripts in Oracle WebLogic Server for OKE.
Topics:
The following section reference files in the input directory that you need create. Depending on the type of stack (JRF or non-JRF), create the appropriate files in the inputs directory. For information about the input files, see Sample Scripts.
To invoke terraform scripts in an infrastructure:
Complete the following steps:
- Go to the directory, where you unzipped the terraform configuration files.
- Initialize the terraform provider plugin:
$ terraform init
- Initialize the environment with terraform environment var files:
$ source inputs/env_vars
- Invoke apply passing all
*.tfvars
files as input:Tip:
If you do not specify the -var-file, then the defaults invars.tf
will apply.- WebLogic Non-JRF:
$ terraform apply -var-file=inputs/instance.tfvars
- WebLogic JRF with OCI database:
$ terraform apply -var-file=inputs/instance.tfvars -var-file=inputs/oci_db.tfvars
- WebLogic JRF with ATP database:
$ terraform apply -var-file=inputs/instance.tfvars -var-file=inputs/atp_db.tfvars
- WebLogic Non-JRF:
- Create multiple instances from same solutions:
$ terraform apply -var-file=inputs/instance.tfvars -state=<file_name>
Where, <file_name> is the unique directory name or state file name for each stack.
To update an infrastructure:
Complete the following steps:
- Update the variables. For the list of variables you can update, see Table 1-1.
- Complete step 1 through step 4 in Invoke terraform scripts.
To destroy an infrastructure:
$ terraform destroy -var-file=inputs/instance.tfvars
Delete the Resources and Stack
Tip:
You can invoke terraform scripts by using the Resource Manager. See Get Started with Oracle WebLogic Server for OKE and Managing Stacks and Jobs.