Terraform support for Vertex AI

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:

Vertex AI product or service Terraform resource Terraform configuration samples
Vertex AI Workbench google_notebooks_environment
google_notebooks_instance View in GitHub
google_notebooks_instance_iam
google_notebooks_location
google_notebooks_runtime View in GitHub
google_notebooks_runtime_iam
google_workbench_instance View in GitHub
Vertex AI managed datasets google_vertex_ai_dataset View in GitHub
Online predictions (AutoML and custom training) google_vertex_ai_endpoint View in GitHub
Vertex AI Feature Store google_vertex_ai_feature_group
google_vertex_ai_feature_group_feature
google_vertex_ai_feature_online_store
google_vertex_ai_feature_online_store_featureview
Vertex AI Feature Store (Legacy) google_vertex_ai_featurestore View in GitHub
google_vertex_ai_featurestore_entitytype View in GitHub
google_vertex_ai_featurestore_entitytype_feature
google_vertex_ai_featurestore_iam
Vertex ML Metadata google_vertex_ai_metadata_store View in GitHub
Vector Search google_vertex_ai_index View in GitHub
google_vertex_ai_index_endpoint
Vertex AI TensorBoard google_vertex_ai_tensorboard View in GitHub

Learn more about Terraform

What's next