Hi everyone,
I'm provisioning a Databricks workspace on GCP using Terraform with the databricks_mws_workspaces resource and an existing customer-managed VPC.
During workspace provisioning, I'm encountering the following permission errors:
Current understanding of the issue
Databricks uses compute.subnetworks.setIamPolicy to grant its workspace service account permission to use the workspace subnet during workspace provisioning.
My understanding is that the following permissions are required:
compute.subnetworks.getIamPolicy and compute.subnetworks.setIamPolicy on the Databricks workspace subnets only.
roles/iam.roleViewer on the host project to provide the iam.roles.get permission.
The proposed approach is to grant these permissions to deployment service account only on the Databricks subnets:
europe-west1-data-platform-databricks-ws1
europe-west1-data-platform-databricks-ws2
europe-west1-data-platform-databricks-ws3
europe-west1-data-platform-databricks-ws4
europe-west1-data-platform-databricks-ws5
This would follow a least-privilege approach, restricting subnet IAM policy management to the specific Databricks subnets rather than granting broad permissions at the host project level.
However, I'm currently unable to obtain compute.subnetworks.setIamPolicy permission from the Cloud/Network team due to their IAM restrictions.
Alternative approach under consideration: Least-Privilege Workspace
I'm considering moving from the current databricks_mws_workspaces Terraform-based provisioning approach to Databricks' GCP Least-Privilege Workspace creation workflow.
My understanding is that this approach separates workspace creation permissions from the permissions required by the workspace service account and allows network permissions to be provisioned separately.
Questions
Is granting compute.subnetworks.getIamPolicy and compute.subnetworks.setIamPolicy at the individual subnet level, along with roles/iam.roleViewer at the host-project level, the correct and recommended approach for the existing databricks_mws_workspaces Terraform workflow?
Can these permissions be restricted to individual subnets using a custom IAM role, without requiring broader Compute Network Admin or Project IAM Admin permissions?
Would migrating to the GCP Least-Privilege Workspace workflow eliminate the need for the workspace deployment service account to have compute.subnetworks.setIamPolicy permission?
In the Least-Privilege Workspace approach, can the Cloud/Network team pre-provision the required subnet IAM bindings for the Databricks workspace service account, while the Databricks team retains responsibility for workspace provisioning?
Are there any limitations or differences in using an existing customer-managed VPC with the Least-Privilege Workspace workflow compared with the traditional databricks_mws_workspaces approach?
I'd appreciate guidance from anyone who has implemented GCP Databricks workspace provisioning with strict IAM separation and least-privilege access.