Cleaning Up a Deployment of Infrastructure Provisioning

This section shows you how to clean up your Oracle Cloud Infrastructure environment after a successful or failed deployment of JD Edwards EnterpriseOne infrastructure provisioning.

Removing All Instance Resources for a Production Environment

Use this procedure to remove all the instance resources in Oracle Cloud Infrastructure that were provisioned by the deployment of JD Edwards infrastructure provisioning for a production environment in a single availability domain (AD).

  1. Navigate to this directory on your OpenTofu staging server:

    JDERefArch_InfraProvisioning/TerraformScripts/pd

  2. Run this command as a single contiguous line command (line breaks below added for clarity):

    tofu destroy

    -var-file=../inputJson/common.json

    -var-file=../inputJson/pdsubnet.json

    -var-file=../inputJson/pd.json

    -var db_admin_password='<dbpwd>'

    -var dep_password='<depPwd>'

    -var dep_subname='depSubName'

Note: In the above command, the values db_admin_password, dep_password, and dep_subname do not have to be the literal values. That is, you use any syntactically valid string such as abc. You must provide a value here, otherwise the cleanup script will stop at this point and prompt for values. It is not necessary to provide the actual list of subnets to destroy, although you can provide a list of those subnets if you prefer. The list of subnets includes the admin subnet, db subnet , mid subnet, and pdDNSZoneName.

Removing All Instance Resources for a Non-Production Environment

Use this procedure to remove all the instance resources in Oracle Cloud Infrastructure that were provisioned by the deployment of JD Edwards EnterpriseOne infrastructure provisioning for a non-production environment in a single AD.

  1. Navigate to this directory on your OpenTofu staging server:

    JDERefArch_InfraProvisioning/TerraformScripts/nonpd

  2. Run this command as a single contiguous line command (line breaks below added for clarity):

    tofu destroy

    -var-file=../inputJson/common.json

    -var-file=../inputJson/pdsubnet.json

    -var-file=../inputJson/nonpd.json

    -var db_admin_password='<dbPwd>'

    -var dep_password='<depPwd>'

    -var dep_subname='depSubName'

Note: In the above command, the values db_admin_password, dep_password, and dep_subname do not have to be the literal values. That is, you use any syntactically valid string such as abc. You must provide a value here, otherwise the cleanup script will stop at this point and prompt for values. It is not necessary to provide the actual list of subnets to destroy, although you can provide a list of those subnets if you prefer. The list of subnets includes the admin subnet, db subnet , mid subnet, and pdDNSZoneName.

Removing a WebLogic Subscription

After you have removed all resources for Production and Non-Production environments, you must run these commands to remove WebLogic subscription information.

Production Environment

  1. Navigate to this directory on your OpenTofu staging server:

    cd <root>/JDERefArch_InfraProvisioning/TerraformScripts/wlsImageSubscription/pd Subscription

  2. Run this command as a single contiguous line command:

    tofu destroy -var-file=/home/opc/JDERefArch_InfraProvisioning/TerraformScripts/inputJson/common.json

Non-Production Environment

  1. Navigate to this directory on your OpenTofu staging server:

    cd <root>/JDERefArch_InfraProvisioning/TerraformScripts/wlsImageSubscription/nonpd Subscription

  2. Run this command as a single contiguous line command:

    tofu destroy-var-file=/home/opc/JDERefArch_InfraProvisioning/TerraformScripts/inputJson/common.json

Removing All Instance Resources for a Disaster Recovery Environment

Use this procedure to remove all instance resources for a disaster recovery environment that was provisioned by the deployment of JD Edwards EnterpriseOne infrastructure provisioning.

  1. Navigate to this directory on your OpenTofu staging server:

    JDERefArch_InfraProvisioning/TerraformScripts/pdDR

  2. Run this command as a single contiguous line command:

    tofu destroy -var-file=../inputJson/drpd.json -var-file=../inputJson/drcommon.json -var- file=../inputJson/drpdsubnet.json

Removing Virtual Cloud Network (VCN) Resources for a Primary Site

Use this procedure to remove all the Virtual Cloud Network (VCN) resources in Oracle Cloud Infrastructure that were provisioned by the deployment of JD Edwards EnterpriseOne infrastructure provisioning.

  1. Navigate to this directory on your OpenTofu staging server:

    JDERefArch_InfraProvisioning/TerraformScripts/global

  2. Run this command as a single contiguous line command:

    tofu destroy -var-file=../inputJson/common.json -var-file=../inputJson/vcn.json

Removing Virtual Cloud Network (VCN) Resources for a Disaster Recovery Site

Use this procedure to remove all the Virtual Cloud Network (VCN) resources in Oracle Cloud Infrastructure that were provisioned by the deployment of JD Edwards EnterpriseOne infrastructure provisioning.

  1. Navigate to this directory on your OpenTofu staging server:

    JDERefArch_InfraProvisioning/TerraformScripts/globalDR

  2. Run this command as a single contiguous line command:

    tofu destroy -var-file=../inputJson/drpd.json -var-file=../inputJson/drcommon.json -var-file=../inputJson/drpdsubnet.json

Use Case Examples

You may need to clean up infrastructure provisioning in the following cases:

  • You want to destroy an existing provisioned infrastructure that you no longer require and want to start a fresh deployment of infrastructure provisioning.
  • You have tried multiple times to rerun a deployment of infrastructure provisioning but the deployment has failed every time. In this case you may want to start a fresh deployment of infrastructure provisioning.

To remove environments that were provisioned in a single AD, execute these commands in the given order. In these commands, each paragraph is a single contiguous line.

Non-Production

cd JDERefArch_InfraProvisioning/TerraformScripts/nonpd

tofu destroy -var-file=../inputJson/common.json -var-file=../inputJson/pdsubnet.json -var-file=../inputJson/nonpd.json -var db_admin_password='<dbPwd>' -var dep_password='<depPwd>' -var dep_subname='depSubName'

Production

cd JDERefArch_InfraProvisioning/TerraformScripts/pd

tofu destroy -var-file=../inputJson/common.json -var-file=../inputJson/pdsubnet.json -var-file=../inputJson/pd.json -var db_admin_password='<dbPwd>' -var dep_password='<depPwd>' -var dep_subname='depSubName'

Global (Virtual Cloud Network Resources – Primary site )

cd JDERefArch_InfraProvisioning/TerraformScripts/global

tofu destroy -var-file=../inputJson/common.json -var-file=../inputJson/vcn.json

Production Disaster Recovery

cd JDERefArch_InfraProvisioning/TerraformScripts/pdDR

tofu destroy -var-file=../inputJson/drcommon.json -var-file=../inputJson/drvcn.json

Global Disaster Recovery (Virtual Cloud Network Resources – Disaster Recovery site)

cd JDERefArch_InfraProvisioning/TerraformScripts/globalDR

tofu destroy -var-file=../inputJson/drcommon.json -var-file=../inputJson/drvcn.json