The Simplest Way to Make Databricks ML and Pulumi Work Like They Should
Teams use databricks ml and pulumi to build and manage machine learning platforms with code. Pulumi sets up the cloud workspaces, compute clusters, and roles that Databricks ML needs to train and serve models. Data teams need repeatable ways to spin up model training spaces. Manual setup in a web console leads to human errors and drift. Writing your setup in general programming languages keeps dev and prod spaces matched. It also gives engineers version control for every cluster, job, and secre
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams use databricks ml and pulumi to build and manage machine learning platforms with code. Pulumi sets up the cloud workspaces, compute clusters, and roles that Databricks ML needs to train and serve models.
Data teams need repeatable ways to spin up model training spaces. Manual setup in a web console leads to human errors and drift. Writing your setup in general programming languages keeps dev and prod spaces matched. It also gives engineers version control for every cluster, job, and secret.
How databricks ml and pulumi share identity and state
Pulumi talks to the Databricks API to create and update workspace resources. You first log in to your cloud provider and the Databricks account console. Pulumi uses a service principal or token to prove its identity during each run.
Once logged in, Pulumi reads your code and compares it to the current state. It then calls the API to build clusters, set up jobs, and assign permissions. Data flows inside the workspace while Pulumi tracks resource IDs in its state file.
Model training jobs need read and write permissions for cloud storage buckets. Pulumi sets up these cloud IAM roles and links them to your workspace. Your training jobs can then read raw tables and write model files with ease.
Common failure modes and how to scope permissions
Many teams make the mistake of using one admin token for all Pulumi runs. If that broad token leaks, an attacker can delete workspaces or read sensitive data. Shared service accounts also make it hard to see who changed a cluster rule.
Another common issue happens when engineers change cluster settings by hand in the UI. The next Pulumi run will either overwrite those manual fixes or fail with errors. Unlogged queries and untracked changes break the link between your code and live systems.
Pulumi Policy as Code + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix this by giving each project its own scoped service principal. Grant that identity only the exact permissions it needs for its target workspace. Lock down the Pulumi state file in a secure bucket with strict read rules.
You should also restrict network paths between your deployment runner and the workspace API. Run your deployment jobs inside a private network instead of on developer laptops. Keep production data safe by masking fields like emails, phone numbers, and card numbers.
Managing model lifecycles across dev and prod
Good machine learning workflows separate model testing from live production serving. You can use Pulumi stacks to copy the same workspace setup across multiple stages. A dev stack can use small clusters with sample data to save cloud costs.
When a model is ready, your pipeline promotes the code to the prod stack. Pulumi provisions larger clusters and stricter access rules for the production run. Data scientists focus on model quality while platform rules stay locked in code.
This split keeps manual work out of your live serving spaces. Every change goes through peer review before the runner touches a live workspace. Teams move fast and keep a clean audit trail for every single update.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
How should Pulumi log in to a Databricks workspace?
Use an OAuth service principal instead of a personal token tied to a user. Scope that service principal to the specific workspace and resource group it manages.
Should Pulumi manage model training data directly?
No, Pulumi should only set up the storage buckets, catalogs, and access roles. Let your data pipelines and training jobs handle the actual tables and files.
How do we stop manual edits from breaking Pulumi state?
Remove edit permissions for human users in staging and production workspaces. Force all cluster and job changes to go through your version control pipeline.
Related guides
In this post