Invoke Terraform Scripts
Use specific commands to invoke the Terraform scripts in Oracle WebLogic Server for OCI.
Note:
You can download a previous version of the terraform script from: https://releases.hashicorp.com/terraform/Invoke terraform scripts in an infrastructure
- Go to the directory where you unpacked the Terraform Configuration File (.zip) file using Download a Terraform Configuration File.
- In this directory, create a terraform file:
terraform.tfvars - In the
terraform.tfvarsfile, add the variables that are referenced in theprovider.tffile.These are the variables that you noted in the
provider.tffile in Download a Terraform Configuration File.For a sample of
terraform.tfvarsfile, see Sample Scripts. - Run the following command to initialize the terraform provider plugin:
$ terraform init - Add in the variables required for the desired topology to the
terraform.tfvarsfile.For the list of variables, see Variables in Terraform Scripts and Sample Scripts.
- Run the following command to invoke apply:
$ terraform apply - Optional: Run the following command to create multiple instances from same solutions:
$ terraform apply -state=<file_name>Where, <file_name> is the unique directory name or state file name for each stack.
Update an infrastructure:
- Go to the directory where you unpacked the Terraform Configuration File (.zip) file using Download a Terraform Configuration File.
- In this directory, create a terraform file:
terraform.tfvars - In the
terraform.tfvarsfile, add the variables that are referenced in theprovider.tffile.These are the variables that you noted in the
provider.tffile in Download a Terraform Configuration File.For a sample of
terraform.tfvarsfile, see Sample Scripts. - Update the variables required for the desired topology to the
terraform.tfvarsfile. For the list of variables you can update, see Table 1-1. - Run the following command to invoke apply:
$ terraform apply
Destroy an infrastructure
$ terraform destroyTip:
You can invoke terraform scripts by using the Resource Manager. See Get Started with Oracle WebLogic Server for Oracle Cloud Infrastructure and Managing Stacks and Jobs.