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

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use cloudformation and pulumi together to run old templates alongside new code. This setup lets engineers read old stack outputs and build new apps fast. Many companies have hundreds of old stacks running in their cloud accounts today. Moving all of them to a new tool takes too much time. Instead, teams link the two tools so they can share cloud data. One tool manages the base network while the other deploys the app layer. How roles and data flow between cloudformation and pulumi Both

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 cloudformation and pulumi together to run old templates alongside new code. This setup lets engineers read old stack outputs and build new apps fast.

Many companies have hundreds of old stacks running in their cloud accounts today. Moving all of them to a new tool takes too much time. Instead, teams link the two tools so they can share cloud data. One tool manages the base network while the other deploys the app layer.

How roles and data flow between cloudformation and pulumi

Both tools talk to the same cloud provider APIs to make changes. They need a valid cloud role with permission to read and write resources. When you run a deploy job, the new tool logs into the cloud. It queries the old stack to read output values like network IDs.

The old stack stores its state inside the cloud provider service itself. The new tool stores its own state in a separate backend store. Data flows one way from the old stack outputs into the new program. The new program reads those values and uses them to build new resources. It does not change or delete the old stack during this step.

Teams can also deploy an entire template from inside the new tool. In this mode, the new tool sends the template file to the cloud. The cloud service then builds the resources and reports the status back. This keeps the old template intact while unifying the deploy workflow for devs.

Common failure modes and how to scope permissions

The biggest risk in a dual setup is using shared admin keys. Teams often give a build runner full cloud rights to fix errors fast. If a bad actor steals that key, they control both state systems. Another common problem happens when two tools try to update one resource.

When both systems edit the same resource, state drift happens right away. The next deploy will fail or wipe out needed cloud settings. Unlogged queries between the tools also make audits hard for security teams. You cannot tell which engineer or job read a sensitive stack output.

CloudFormation Guard + Pulumi Policy as Code: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, give each tool its own scoped cloud role. The new tool should only have read access to the old stack outputs. Never allow it to write or delete resources managed by the old system. Use short-lived role sessions instead of static keys stored in build servers. Lock down network paths so only trusted runners can reach the state backend.

When to migrate templates versus reading stack outputs

Not every old stack needs to become code in your new tool. Core networks and base storage accounts rarely change once they are live. Keep those stable parts in the old templates and just read their outputs. This lowers risk and saves your team weeks of rewrite work.

Move fast-changing app services and serverless jobs to the new tool first. Developers get loops in real code while base systems stay safe and untouched. When an old stack needs major changes, convert it into code then. After the conversion finishes, import the live resources into the new state file. Then you can remove the old template without taking down any live apps.

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

Can both tools manage the exact same cloud resource at once?

No, only one tool should own and write to a cloud resource. Let one tool create the item and let the other read its ID.

How does the new tool read values from an old stack?

The old stack exports values like subnet IDs as named stack outputs. The new tool queries the cloud API by stack name to read them.

What happens if someone deletes an exported output in the old stack?

The cloud provider blocks the delete if another stack links to it. If read via API, the next deploy in the new tool will fail.

The query runs. The emails stay hidden.