← All insightsBest Practices

Common Pulumi mistakes and how to avoid them

CodeWizard Academy · 22 November 2025 · 3 min read · Intermediate

Most Pulumi pain is self-inflicted and predictable. Here are the mistakes we see most, and the fix for each.

Mistake 1: Putting imperative logic with side effects in resource code

Fix: Keep programs declarative; push logic into tested helpers. Make it the default in your templates and enforce it in review or CI so the mistake cannot come back.

Mistake 2: Leaking secrets into stack config without encryption

Fix: Use pulumi config set --secret for encrypted config. Make it the default in your templates and enforce it in review or CI so the mistake cannot come back.

Mistake 3: No unit tests despite using a real language

Fix: Write unit tests with the language's normal test tools. Make it the default in your templates and enforce it in review or CI so the mistake cannot come back.

A safer baseline

An S3 bucket defined in TypeScript.

typescript
import * as aws from "@pulumi/aws";

const assets = new aws.s3.BucketV2("assets", {
  bucket: "acme-assets",
  tags: { Environment: "prod" },
});

export const bucketName = assets.bucket;

Want senior help putting Pulumi to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult