Configure the Terraform Modules

Configure the Terraform modules to define the resources.

About the Terraform Code

The Terraform code for this solution is organized into modules, each containing the resources for a specific component of the target topology.

Coding your cloud resources in Terraform configuration files enables you to provision the entire topology quickly and manage the resources efficiently. The files are designed to be reusable modules that you can use to quickly set up new environments, now or in the future.

The Terraform code contains the following directories and files at the top level:
  • *.tf: The Terraform configuration files that the solution uses. Do not edit these files.
  • .github directory and .gitignore: Internal Github configuration files. Do not edit them.

Before You Begin Configuring Terraform

Before you start configuring the Terraform modules, keep the following information ready:

  • The OCID of your tenancy.

    You can find your tenancy's OCID in the Oracle Cloud Infrastructure web console. Select Administration from the services menu, and then click Tenancy Details.

  • The OCID of the user that you want Terraform to use to authenticate with Oracle Cloud Infrastructure.

    To find the user's OCID, select Identity from the services menu, and then select Users. Locate your user name in the list, and copy its OCID.

  • The OCID of the compartment in which you want to create the resources.

    To find a compartment's OCID, select Identity from the services menu, and then select Compartments. Locate the compartment that you need in the list, and copy its OCID.

  • The ID of region where you want to create the resources.

    For example, the ID of the US East (Ashburn) region is us-ashburn-1.

    See Regions and Availability Domains.

  • The compute shape to be used for the bastion host and the admin host.

    See Compute Shapes.

Download the Terraform Code

The Terraform code for this solution is available on GitHub.

  1. In the navigation pane on the left, click Download Code to display the download links.
  2. Click oci-cli Client.
  3. Clone or download the repository to your local computer.
  4. Click OCI ATP for Apache Tomcat.
  5. Clone or download the repository to your local computer.

Set the Terraform Variables

Specify the parameters required for Terraform to connect to the Oracle Cloud Infrastructure tenancy. Also specify the networking parameters and certain attributes of the bastion host.

  1. Create a terraform.tfvars file in a plain-text editor, and set values for the variables in it as follows:
    Variable Description
    tenancy_id (required) The OCID of your tenancy.
    compartment_id (required) The OCID of the compartment in which you want to create the resources.
    region Region ID where you want to deploy the infrastructure.
    ssh_public_key_path The string content of the public key to be used to connect to the instance with SSH.
    atp_db_name The name to give the Autonomous Transaction Processing database.
    atp_name The name to give to the Autonomous Transaction Processing database system, containing the database.
    numberOfNodes The number of Apache Tomcat servers to provision
    user_ocid The OCID of the user (user_ocid).
    fingerprint The fingerprint for the key pair being used (finger_print).
    private_key_path The path (including filename) of the private key stored on your computer (pem_private_key_path).
  2. Save and close the terraform.tfvars file.