Establish the Commvault Terraform Provider

Updated

To establish the CommvaultTerraform provider, create the Commvault Terraform provider configuration file, and then initialize the Commvault Terraform provider.

Procedure

  1. On your computer, go to any directory, such as C:.

  2. Create a provider configuration file with .tf extension , and then name it as main.tf.

    Note: After saving the main.tf file, verify that the file extension is .tf.

  3. Update the Commvault Terraform provider file:

    1. Open the main.tf file, and then copy the following block to it:

      terraform {

      required_providers {

      commvault = {

      source = "Commvault/commvault"

      }

      }

      }

      provider "commvault" {

      web_service_url = "URL of the commserver webservice"

      user_name = "username that is used to call APIs"

      password = "password in base 64 encoded format"

      }

      To encode the password in base64 format, enter or paste your password in the Encode to Base64 format box in the base64encode.org website.

      Where:

      • commvault is the name of the Terraform provider

      • web_service_url is the URL of the CommServe web service

      • username and password are the user credentials that are used for API authentication. These credentials must have appropriate permissions on the entity that you want to perform an action on through Terraform provider resource

    2. Save the main.tf file.

  4. Initialize the Commvault Terraform provider:

    1. In the Windows command prompt, go to the folder that has the main.tf file.

    2. Run the following command:

      Terraform init