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 (OCI) service that allows you to automate the process of provisioning your OCI 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 the Resource Manager documentation.

To test the terraform configuration in Resource Manager, follow these steps:

  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 the Resource Manager 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 OCI region in which you have created the custom image.
    provider "oci" {
      region           = var.region
    }

    For information about defining providers, see Configuration File Requirements in the Resource Manager 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 the Resource Manager documentation.
  5. Create a stack in Resource Manager. See Creating a Stackn the Resource Manager documentation.
  6. Run the plan job. See Creating a Plan Job n the Resource Manager documentation.
  7. Run the apply job. See Creating an Apply Job in the Resource Manager 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.