To establish the CommvaultTerraform provider, create the Commvault Terraform provider configuration file, and then initialize the Commvault Terraform provider.
Procedure
On your computer, go to any directory, such as C:.
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.
Update the Commvault Terraform provider file:
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"
}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
Save the main.tf file.
Initialize the Commvault Terraform provider:
In the Windows command prompt, go to the folder that has the main.tf file.
Run the following command:
Terraform init