The Simplest Way to Make Harness and Pulumi Work Like They Should
Teams use harness and pulumi together to build cloud resources and ship code in one place. Harness runs the pipeline steps while Pulumi writes the cloud state using standard code. This pairing lets developers use familiar languages like TypeScript, Python, or Go for cloud setups. Harness then adds policy checks, approval gates, and build logs around every single deployment run. When you join both tools, you avoid manual cloud edits and keep changes in Git. Your team gets a clear path from code
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 harness and pulumi together to build cloud resources and ship code in one place. Harness runs the pipeline steps while Pulumi writes the cloud state using standard code.
This pairing lets developers use familiar languages like TypeScript, Python, or Go for cloud setups. Harness then adds policy checks, approval gates, and build logs around every single deployment run. When you join both tools, you avoid manual cloud edits and keep changes in Git. Your team gets a clear path from code commit to live cloud updates.
How harness and pulumi pass identity and data
To make harness and pulumi work, your build steps need two sets of keys. First, the build worker needs a token to talk to the Pulumi state backend. Second, the worker needs cloud provider keys to create or change servers and databases.
Harness starts a step in a clean container on your build farm. That container pulls your code from Git and reads the stack settings. Next, Harness passes the stored secrets into the container for that single run. Pulumi reads those secrets, checks the current state, and computes the needed cloud changes.
During a preview step, Pulumi only reads state and sends a plan back to Harness. Harness shows this plan in the build log so reviewers can check every line. After a team lead approves the step, Harness triggers the update step to apply changes. Pulumi then writes the new state and sends the final outputs back to the pipeline. Subsequent pipeline steps can read those outputs to deploy apps onto the new servers.
Common failure modes and how to scope permissions
Many teams start by putting one big admin key into their Harness secret store. Every pipeline then uses that same key to run Pulumi across all cloud accounts. This setup creates a big risk if a build script leaks the token. It also makes audit logs useless because every change looks like the same bot user.
Another common issue happens when teams share a single Pulumi token across all projects. If one developer edits a pipeline script, they can read state from other teams. State files often hold sensitive strings, database endpoints, or internal network details. Without strict bounds, a test pipeline can break live production apps by mistake.
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 pipeline its own role and cloud identity. Use short-lived tokens through OpenID Connect instead of static long-term keys whenever possible. Map each Harness project to a specific cloud role that only touches its own resources. On the Pulumi side, scope access tokens to single stacks or specific team groups.
You should also lock down network paths between your build workers and private cloud networks. Place your Harness delegates inside isolated subnets that only reach the target cloud APIs. Turn on strict audit logs in both tools so you can trace every single run. Good logs show who approved the Harness step and what Pulumi changed in the cloud.
Separating preview steps from live update steps
A safe pipeline always splits the preview check from the actual cloud update step. In the preview stage, give the worker a role that only has read permissions. This prevents a bad script or code bug from changing live resources during a test.
When the preview passes, pause the Harness pipeline and ask for a human check. The reviewer looks at the exact list of resources that will change or get deleted. Once approved, the update step runs with a separate role that allows write actions. This simple split stops accidental deletes before they ever reach your production cloud.
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 we store Pulumi state when running pipelines in Harness?
Use the managed Pulumi service or a locked cloud bucket with state locking turned on. State locking stops two Harness pipelines from changing the same cloud stack at the same time.
Can we pass Pulumi stack outputs to later steps in a Harness pipeline?
Yes, your build step can export stack outputs as step variables inside the Harness run. Later steps can read those variables to find host names, cluster details, or app ports.
How do we stop developers from seeing cloud keys in the Harness build logs?
Store all tokens in the Harness secret manager and mark sensitive values as secret outputs. Both tools will scrub known secret strings from the console output during the build run.
Related guides
In this post