Skip to main content

Terraform Provider

You can use the Commvault Terraform provider to interact with your CommCell environment using Terraform configurations. The provider allows you to manage and automate your infrastructure efficiently.
Terraform Provider
You can find the Commvault Terraform provider on Terraform Registry
Get Started on Commvault Terraform Provider

1

How to use the provider
terraform {
required_providers {
commvault = {
source = "Commvault/commvault"
version = "1.2.10"
}
}
}

2

Authenticate Terraform with Commvault APIs
provider "commvault" {
web_service_url = "URL of the commserver webservice/webconsole api endpoint"
user_name = "username that is used to call APIs"
password = "password in base 64 encoded format"
ignore_cert = "true/false to ignore certificate warnings for https endpoints"
}

3

Use the commvault_hypervisor_azure resource type to create or delete an Azure hypervisor in the CommCell environment
resource "commvault_hypervisor_azure" "hypervisorazure1" {
name = "Test Terraform Azure Hypervisor1"
subscriptionid = "#################"
accessnodes {
id = data.commvault_client.accessnode4.id
type = 3
}
usemanagedidentity = "true"
}