The Simplest Way to Make Apigee and Pulumi Work Like They Should
Teams use Apigee and Pulumi together to manage API traffic rules as code. Pulumi writes cloud settings while Apigee routes requests and checks user tokens. This setup lets developers ship API changes through standard git workflows. Every routing rule and quota limit stays tracked in version control. Teams stop making manual edits in the cloud console. Instead, they review code changes before any update reaches production. How Apigee and Pulumi share roles and data Pulumi talks to Google Clou
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 Apigee and Pulumi together to manage API traffic rules as code. Pulumi writes cloud settings while Apigee routes requests and checks user tokens.
This setup lets developers ship API changes through standard git workflows. Every routing rule and quota limit stays tracked in version control. Teams stop making manual edits in the cloud console. Instead, they review code changes before any update reaches production.
How Apigee and Pulumi share roles and data
Pulumi talks to Google Cloud APIs to build and update Apigee resources. It uses a cloud service account to prove its identity during each run. This account needs specific roles to create instances, groups, and routing rules.
When a developer merges code, the build runner starts a Pulumi update. Pulumi reads the current state file to see what already exists. Then it sends requests to the Google Cloud API to make the needed changes. Apigee receives these instructions and updates its runtime instances.
Data flows in both directions during a deployment run. Pulumi sends new setup details to the cloud control plane. The cloud API sends back status codes and resource IDs. Pulumi saves these IDs in its state store for future runs. No user traffic passes through Pulumi at any point. Live API calls go straight to the Apigee runtime plane.
Common failure modes in API code deployments
Many teams give their Pulumi runner a broad owner role at first. This makes early testing fast, but it creates huge risks in production. If a build script leaks that broad key, an attacker can delete whole projects. Shared service accounts also hide who ran a change. The cloud logs only show the shared bot name, not the human developer.
Manual console edits cause another common failure mode. An engineer might fix a broken API route in the web UI during an outage. The next Pulumi run will not know about this manual fix. It may overwrite the fix or fail with a state conflict error. Long build times also cause pain with Apigee. New runtime instances take a long time to start up. Build runners can time out if they wait on every step in one big stack.
Pulumi Policy as Code + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged database queries and broad data rules also hurt API backends. When Apigee routes traffic to internal data stores, raw personal data can leak. Teams need data masking to rewrite matched fields like emails, phone numbers, and card numbers in results.
Scoping roles and network paths between systems
You can fix these issues by splitting your Pulumi stacks into small parts. Put slow base resources like Apigee instances and networks in one core stack. Put fast-changing API bundles and products in a separate app stack. Give each stack its own cloud service account with minimal rights. The app stack account should only edit API bundles, not delete the whole instance.
Lock down network paths between your build runners and the cloud API. Run your deployments from private build workers inside your cloud network. Block public console edits in production so all changes must pass through code review. Use short-lived identity tokens instead of static JSON keys for your build runners. This ensures every deployment leaves a clear audit trail tied to a real commit.
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
Should we put Apigee instances and API bundles in the same Pulumi stack?
No, you should keep them in separate stacks. Instances take a long time to build and rarely change. API bundles change often and deploy fast when kept in their own stack.
How do we stop engineers from editing Apigee routes in the cloud console?
Remove write roles from human users in your production cloud project. Give write roles only to the Pulumi service account. Let humans have read-only roles to check logs and metrics.
How should Pulumi log in to Google Cloud during automated builds?
Use workload identity federation instead of static service account keys. Your build system trades its own short token for a temporary cloud token. This removes the need to store long-lived secrets.
Related guides
In this post