databricks

Terraform Configuration for Databricks VPC and PSC Setup

Overview

This Terraform configuration is designed to set up Google Cloud Platform (GCP) infrastructure required to create a Databricks workspace within customers GCP project including the creation of subnets, Private Service Connect (PSC) subnets, and necessary firewall rules. It also includes the option to create Customer Managed Keys (CMK) for encryption. Please note that we are only creating pre-requistes required to provision a Databricks workspace. Depending upon your needs you could create workspaces:

Required IAM Roles

To successfully create the resources defined in this Terraform configuration, ensure that the service account or user account you are using has the following IAM roles:

Configuration Files

variables.tf

This file defines the variables used in the Terraform configuration. Key variables include:

terraform.tfvars

This file contains the values for the variables defined in variables.tf. You can customize the values according to your requirements. Key configurations include:

Usage

  1. Rename terraform.tfvars.remove: Rename terraform.tfvars.remove by removing remove from the end of the file extension. Update variables so that it has your desired values

  2. Initialize Terraform: Run the following command to initialize Terraform and download the necessary provider plugins.

    terraform init
    
  3. Plan the Deployment: Generate an execution plan to see what resources will be created.

    terraform plan
    
  4. Apply the Configuration: Apply the Terraform configuration to create the resources in GCP.

    terraform apply
    

    Confirm the action when prompted.

  5. Verify Resources: After the apply completes, you can verify the created resources in the GCP Console or by running

    terraform output
    

Cleanup

To destroy all resources created by this configuration, run:

terraform destroy

Confirm the action when prompted.

Notes