The Simplest Way to Make Pulumi and Tcp Proxies Work Like They Should
Using pulumi and tcp proxies together lets teams build cloud stacks and route raw port traffic. This setup helps engineers deploy databases and reach private backend ports from one workflow. Cloud teams use code to spin up servers, networks, and data stores every day. Those private systems sit inside closed networks with no public web addresses. Engineers and build runners still need a safe network path to reach those ports. Putting these two tools together solves the deployment step and the ro
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.
Using pulumi and tcp proxies together lets teams build cloud stacks and route raw port traffic. This setup helps engineers deploy databases and reach private backend ports from one workflow.
Cloud teams use code to spin up servers, networks, and data stores every day. Those private systems sit inside closed networks with no public web addresses. Engineers and build runners still need a safe network path to reach those ports. Putting these two tools together solves the deployment step and the routing step at once.
How pulumi and tcp proxies handle traffic and roles
Pulumi reads your code and calls cloud APIs to create servers and network rules. TCP proxies listen on a designated port and forward raw packets to backend targets. When you combine them, your deployment code defines the network path and the listener instances.
First, the build runner logs in to the cloud provider using a scoped role. The tool checks the current state of your stack and compares it to your code. Next, it creates the private database and sets up the network listener in the cloud. It passes the private database address straight into the listener settings during the run.
Once the run finishes, client apps send traffic to the listener address. The listener checks the source network rules and forwards packets to the private database port. Data flows back and forth over that raw socket without exposing the whole private network. Your deployment state tracks every port rule, IP address, and server instance in one place.
Common failure modes with shared keys and broad ports
Teams often take risky shortcuts when they wire up network listeners with deployment code. The most common mistake is using one shared admin key for all deployment runs. If that key leaks, an attacker can change network rules and open every private port.
Another frequent issue is opening broad network ranges so build runners can reach private targets. Engineers often allow traffic from any IP address just to make a failing build pass. That leaves raw database ports open to port scanners on the public web.
Pulumi Policy as Code + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Plain TCP forwarders also lack deep visibility into what happens inside a session. A basic listener sees raw packets and IP addresses, not user names or SQL queries. When a bad query drops a table, the network log only shows an IP address. You cannot tell which engineer or build job ran the command.
Scoping roles and network paths between systems
To fix these gaps, break your deployment roles into smaller pieces with tight limits. Give the build runner a role that only changes network resources in one account. Store all secret keys in an encrypted state backend so plain text never sits in code.
Lock down network paths by tying security groups to specific source subnets and ports. Never leave listener ports open to the whole internet after a deployment finishes. Set up your deployment code to create strict firewall rules alongside every new listener.
You should also separate the network path for build runners from human user sessions. Build tools need short network sessions to run schema changes and then exit. Engineers need interactive sessions that tie back to their company login and log every action. Keeping these two paths separate makes audits simple and keeps private ports safe.
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 does Pulumi pass private IP addresses to a TCP listener?
The tool reads the private IP output after the database finishes starting up. It then feeds that output variable straight into the listener setup during the same run.
Why do raw TCP listeners struggle with user audits?
Raw listeners operate at the transport layer and only move packets between two ports. They do not read database protocols, so they cannot log user names or query text.
How should teams store secrets used in deployment runs?
Teams should use the built-in secret manager inside their state backend or a cloud kms key. This encrypts sensitive values at rest and keeps plain text out of git repos.
Related guides
In this post