Terraform is an infrastructure-as-code (IaC) tool that you can use to provision resources and permissions for multiple Google Cloud services, including Vertex AI.
Terraform has a declarative and configuration-oriented syntax, which you can use to describe the infrastructure that you want to provision in your Vertex AI project. After you author this configuration in one or more Terraform configuration files, you can use the Terraform CLI to apply this configuration to your Vertex AI resources.
Consider a scenario where you want to apply a standardized configuration to multiple Vertex AI resources of a specific type. Using Terraform, you can streamline the entire process, as follows:
Describe the desired infrastructure in a Terraform configuration file. You don't need to author code describing how to provision this configuration using objects and methods from the Vertex AI API.
Use Terraform to evaluate your Terraform configuration and generate an execution plan. Based on this configuration, Terraform indicates what changes it plans to make to the Vertex AI infrastructure.
Use Terraform to apply the changes in the execution plan. Terraform invokes the Vertex AI API in the background to apply the planned changes.
If a Vertex AI resource or infrastructure object defined in the Terraform configuration does not exist, Terraform creates it.
If a Vertex AI resource or infrastructure object exists but has a different configuration, Terraform updates it to match your Terraform configuration.
If any Vertex AI resource or infrastructure object matches your Terraform configuration, Terraform leaves it unchanged.
Terraform resources available for Vertex AI
Terraform resources represent infrastructure objects. The following table lists the Terraform resources that are currently available for Vertex AI products and services, along with links to Terraform configuration samples: