Skip to main content

GCP — Terraform

You'll deploy a Databricks workspace with BYOVPC on GCP using Terraform in ~20 min.

Prereqs: GCP project, Terraform CLI, Databricks account console

What you'll build

A Databricks workspace deployed into your GCP project with a customer-managed VPC. The Terraform template handles service accounts, GCS buckets, VPC networking, and workspace configuration.

Prerequisites

  • A GCP project with Owner permissions.
  • A Databricks account with account-admin privileges.
  • Terraform CLI installed locally.
  • GCP CLI authenticated (gcloud auth application-default login).

Steps

1. Deploy the workspace

  1. Go to the template repository: GCP BYOVPC Terraform Deployment.
  2. Follow the README.md instructions.
  3. Copy tf/terraform.tfvars.example and fill in your values — project ID, region, and workspace name.
  4. Run terraform init && terraform apply.
  5. Repeat for staging and production workspaces.

Verify

  1. Log in to the Databricks account console.
  2. Navigate to Workspaces and confirm the new workspace shows a Running status.
  3. In the GCP console, verify the VPC and service accounts were created in the target project.

Troubleshoot

Terraform apply fails with API not enabled

The template requires several GCP APIs (Compute Engine, Cloud Storage, IAM). Enable them with gcloud services enable compute.googleapis.com storage.googleapis.com iam.googleapis.com on the target project.

Permission errors during apply

Verify gcloud auth application-default login is authenticated with a principal that has Owner access on the target project. Run gcloud config get-value project to confirm the active project.

Next