# Resources for the Commvault Terraform Module

A resource type is an infrastructure object (such as an endpoint) in Commvault.

To declare a resource type, include a resource type, and within the block body—between curly braces ({ })—include the arguments and attributes that belong to the resource.

The following table lists the operational behavior for resources.

Operation | Behavior
--- | ---
Create | In the configuration file (.tf), include a resource block for the real object. When the configuration is applied, the identifier for that real object is saved as a state in the terraform.tfstate file. The .tfstate file is created after the configuration is applied for the first time. This state is used in responses to manage future changes, such as delete.
Delete | In the configuration file (.tf), remove the complete resource block that represents the object. When the configuration is applied, the Commvault Terraform provider attempts to find the resource block that is associated with the real object. Because no resource block is found, the real object is removed from the CommCell environment.
Modify | In the configuration file (.tf), modify the individual properties in the resource block that represents the object. When the configuration is applied, the Commvault Terraform provider attempts to find the resource block that is associated with the real object. And, the changes are applied to the object.

Note

The `commvault_vmware_hypervisor` resource does not support connections to ESXi hosts; instead, you can use the VCenter name as the host_name.

## Syntax

The following basic syntax applies to all Commvault Terraform provider resources.

    resource "$[commvault_resource_name]" "$[local name]"{
      argument_1 = "$[value] "
    .
    .
    .
      argument_n = "$[value] "
    }

Where:

- commvault_resource_name is the resource type for real object that you want to modify in the CommCell environment.

- local name is the name that is used by the Commvault Terraform provider to refer the resource and has no significance in the target platform.

- argument_1 to argument_n are the attributes that are used for the resource.

## Related Topics

For more information on resources, see Commvault Terraform Provider.

×

Loading...