The Simplest Way to Make GitHub Codespaces and Pulumi Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using github codespaces and pulumi together lets teams write and run cloud changes from a browser. The cloud workspace runs the deployment tool to build servers, networks, and databases. This setup removes local machine drift across your engineering team. Every developer gets the exact same runtime, packages, and command line tools. You no longer waste hours fixing broken local setups before shipping cloud updates. Instead, engineers open a fresh workspace, test their code, and push changes rig

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 github codespaces and pulumi together lets teams write and run cloud changes from a browser. The cloud workspace runs the deployment tool to build servers, networks, and databases.

This setup removes local machine drift across your engineering team. Every developer gets the exact same runtime, packages, and command line tools. You no longer waste hours fixing broken local setups before shipping cloud updates. Instead, engineers open a fresh workspace, test their code, and push changes right away.

How github codespaces and pulumi handle login and data flow

The workflow starts when a developer boots up a fresh cloud workspace. The workspace reads a setup file in the repo and installs the deployment tool. Next, the workspace must log in to both the state backend and the target cloud. Teams often store static tokens in user secrets to make this step work.

Once logged in, the developer runs a preview command inside the remote terminal. The tool reads the code and checks the current state file. It then talks to the cloud provider APIs to compare the live setup against the code. Finally, the tool prints a plan or pushes the live changes to the cloud.

All traffic flows from the remote container straight to the cloud APIs and state store. The workspace holds the active cloud keys in memory during the whole work session. If the code updates a database, the workspace also needs a path to that data store.

Common failure modes and how to scope roles

The biggest risk in this setup is storing long-lived admin keys in workspace secrets. If a bad script runs in the workspace, it can steal those broad tokens. Shared service accounts make this much worse for security teams. When five engineers share one token, the audit logs cannot show who deleted a resource.

Pulumi Policy as Code + GitHub Actions Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another common issue is leaving network paths wide open for remote workspaces. Cloud workspaces often use dynamic IP addresses that change on every boot. Because of this, some teams open their cloud firewalls to the entire internet. That choice exposes sensitive internal databases and control planes to outside attackers.

To fix these issues, stop putting static admin keys inside workspace secrets. Use open identity standards to link the workspace identity to a scoped cloud role. Give each developer role only the exact permissions needed for their current task. Split preview roles from update roles so dev workspaces only have read permissions by default.

Keep production state updates inside locked automation pipelines whenever you can. When engineers must inspect live databases from a workspace, enforce strict role checks and field masking. Masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in query results. Also, log every command and API call tied to the individual user identity.

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

How should we store cloud tokens in a remote workspace?

Avoid storing static cloud keys in workspace secrets whenever you can. Instead, use short-lived federated tokens that expire when the coding session ends. This limits the damage if a workspace secret leaks.

Can developers run production updates from a cloud workspace?

You should limit cloud workspaces to read-only previews for production stacks. Let your main automation pipeline run the actual state updates after a code review. If an emergency requires manual action, use a scoped role with full command logging.

How do we restrict network paths from dynamic workspace IPs?

Do not open your cloud firewalls to the public internet for workspace traffic. Route workspace requests through a secure, authenticated channel that checks user identity first. This keeps your internal databases and cloud APIs hidden from public scans.

The query runs. The emails stay hidden.