The Simplest Way to Make Jenkins and Pulumi Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

In production, jenkins and pulumi work together to build and change cloud systems from code. Jenkins runs the job steps, while Pulumi reads the code and updates your cloud accounts. This pair lets your team test and ship cloud changes through one standard build pipeline. When an engineer pushes code, the build server checks the plan before making live updates. You get a clear history of every change made to your cloud servers and databases. How jenkins and pulumi share keys and data To make

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.

In production, jenkins and pulumi work together to build and change cloud systems from code. Jenkins runs the job steps, while Pulumi reads the code and updates your cloud accounts.

This pair lets your team test and ship cloud changes through one standard build pipeline. When an engineer pushes code, the build server checks the plan before making live updates. You get a clear history of every change made to your cloud servers and databases.

How jenkins and pulumi share keys and data

To make jenkins and pulumi work together, the build runner needs two sets of keys. First, the job must log in to the Pulumi state backend to read past states. Second, the job must log in to your target cloud provider to make real changes.

Data flows in a clear loop during each job run on the build agent. The build agent pulls your source code from version control and starts a clean workspace. Next, the Pulumi engine reads the current state file from its storage backend. It compares your new code against that saved state to build a change plan.

During a pull request, the pipeline runs a preview step and posts the diff back. No real cloud resources change during this preview phase. Once a reviewer approves the code merge, the main branch job runs the update command. The engine sends API calls to your cloud provider and writes the new state file. If a step fails, the runner stops the job and alerts the team right away.

Common failure modes and how to scope roles

Many teams start by putting one static admin key inside the main build server store. Every pipeline job then shares this single broad token to run cloud updates. This setup creates a huge risk for your whole cloud account.

If one test job leaks that token in a build log, attackers gain full control. Shared service accounts also ruin your audit logs. When five teams share one bot user, you cannot tell who broke a live database. Unlogged runs and broad keys make security audits slow and painful.

Pulumi Policy as Code + Jenkins Pipeline Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another common failure happens when two jobs try to update the same stack at once. Without strict queue rules on the runner, state locks fail and pipelines crash mid-run. Stale temporary files left on shared build workers can also leak secrets between different jobs.

You can fix these issues by scoping roles and network paths for every single stack. Give each project its own cloud role with only the exact rights it needs. A web app pipeline should never hold rights to delete core network routes or databases.

Use short-lived tokens through open identity standards instead of static passwords stored on disk. The build server trades a signed job token for a temporary cloud role during each run. When the job ends, that temporary key expires right away.

You should also split preview roles from update roles in your pipeline setup. Give pull request jobs read-only cloud rights so untrusted code cannot alter live systems. Only the main branch runner should hold the write role for production stacks. Finally, place your build agents in isolated network zones and wipe workspaces after every run. Clean workers and strict network rules stop stray test jobs from reaching sensitive internal databases.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should pull request jobs have write permissions in our cloud account?

No, pull request jobs should only run previews using a read-only cloud role. Grant write permissions only to merge jobs running on your protected main branch.

How do we stop two build jobs from updating the same stack at once?

Set your build job to block parallel runs on the same branch or stack. The state backend also uses locks to reject a second update while one runs.

Where should we store stack secrets and API keys for app code?

Store app secrets in your encrypted state config or an external cloud secret manager. Never commit raw keys to git or print secret values in your build logs.

The query runs. The emails stay hidden.