Verifying Terraform Configuration in Resource Manager

Learn about the changes that you must make to test the terraform files in Resource Manager. This topic does not provide step-by-step instructions to create Terraform files.

Resource Manager is an Oracle Cloud Infrastructure service that allows you to automate the process of provisioning your Oracle Cloud Infrastructure resources. The collection of your developed Terraform configurations is known as stacks.

For information about requirements and recommendations for managing Terraform configurations with Resource Manager, see Terraform Configurations for Resource Managerin Oracle Cloud Infrastructure documentation.

To test the terraform configuration in Resource Manager, do the following:

  1. Describe variables in a well formatted YAML file, such as orm_schema.yaml, and add the file to your Stack root directory.Schema documents are recommended for Terraform configurations when using Resource Manager. Including a schema document allows you to facilitate variable entry in the Oracle Cloud Infrastructure Console. For a complete list of requirements and recommendations for Terraform configurations used with Resource Manager, see Schema Documents in Oracle Cloud Infrastructure documentation.
  2. Remove the following variables which provide information about your Oracle Cloud Infrastructure tenancy. You had provided this information earlier to test the terraform configuration files on your local machine. To test the Terraform files in Resource Manager, you must delete these variables from the configuration file.
    provider "oci" {
      tenancy_ocid     = var.tenancy_ocid
      user_ocid        = var.user_ocid
      fingerprint      = var.fingerprint
      private_key_path = var.private_key_path
    }
  3. You'll only need to specify the Oracle Cloud Infrastructure region in which you have created the custom image.
    provider "oci" {
      region           = var.region
    }

    For information about defining providers, see Configuration File Requirements in Oracle Cloud Infrastructure documentation.

  4. Ensure that you have created all the required Terraform files and provided the required information. All the files must be at the root level. Compress the files to save it as a ZIP file. For information about requirements and recommendations for managing Terraform configurations with Resource Manager, see Terraform Configurations for Resource Manager in Oracle Cloud Infrastructure documentation.
  5. Create a stack in Resource Manager. See Creating a Stackin Oracle Cloud Infrastructure documentation.
  6. Run the plan job. See Creating a Plan Job in Oracle Cloud Infrastructure documentation.
  7. Run the apply job. See Creating an Apply Job in Oracle Cloud Infrastructure documentation. Oracle Resource Manager should have created all resources defined in your Stack at this point. It is important to validate that all Infrastructure resources have been created following your Application requirements.

If you get the expected results, then proceed to the next step. If any changes are required, make the required changes to the terraform configuration files, test the updated file in Resource Manager before you proceed with the next step.