D Migrate Terraform Scripts

You can access the Terraform Scripts of an Oracle WebLogic Server for OCI and modify it as required. See Terraform Scripts in Oracle WebLogic Server for OCI.

Support ended for Terraform v0.11.x. So, you would not be able to scale out or destroy the stacks created with Terraform v0.11.x. However, you can configure the stacks in your local environment by downloading the terraform configuration, variables, and terraform state file from your Oracle Resource Manager (ORM) stacks. You can continue using terraform v0.11.x with the downloaded scripts and manage their stacks outside ORM.

Complete the following steps:
  1. Download the previous versions of the terraform from https://releases.hashicorp.com/terraform/.
  2. Install the terraform on the host, where you want to run the scripts.
  3. Download the configuration and terraform state file from the last apply job:
    1. Click the navigation menu Navigation Menu icon, and select Developer Services. Under the Resource Manager group, click Stacks.
    2. Select the Compartment that contains your stack.
    3. Click the name of your stack.
    4. In the Jobs section, select the latest apply job.
    5. Click Download Terraform Configuration and save the file to the preferred location.
    6. Click Download Terraform State and save the file to the preferred location
  4. Extract variables from the stack.
    Run the following OCI CLI command to generate the variables in json format:
    #ensure that oci cli and jq are installed in cloud shell.
    <user>@cloudshell:~ (<domain>-1)$ oci resource-manager stack get --stack-id <OCID> | jq -r .data.variables
  5. Copy the variables into the .json file.

    You can edit the file to reapply parameters, like, node count, VM shape, SSH keys, and so on. For information about the variables, see Variables in Terraform Scripts.

  6. Unzip the terraform configuration files to the working folder (~/wlsoci/).
  7. Copy the terraform state and the varaibles.json fles to the working folder (~/wlsoci/).
  8. As required, by using reapply, scale out or destroy the stacks. See Invoke Terraform Scripts.