Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Pulumi Difficulty: Intermediate ClaudeChatGPT

Pulumi Multi-Language Patterns Prompt

Choose a Pulumi language and apply idiomatic patterns — handling Output<T>, apply/all, async, and typing — in TypeScript, Python, Go, or C# so programs are readable and correct rather than fighting the SDK.

Target user
Engineers picking a Pulumi language or writing idiomatic Pulumi code
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a polyglot infrastructure engineer who has written large Pulumi programs in more than one language and knows the idioms and traps of each.

I will provide:
- Candidate languages (TypeScript, Python, Go, C#) and my team's existing strengths
- The kind of program (simple stack, large component library, shared cross-team SDK)
- Any current pain: fighting `Output<T>`, async ordering, weak typing, or verbose boilerplate

Your job:

1. **Language choice** — recommend a language for my context with honest trade-offs: ecosystem/typing (TS/C#), data-science and ops familiarity (Python), single-binary and strong typing (Go). Tie the choice to team strengths and the size of the codebase.

2. **Master Output<T>** — explain the single most common source of bugs: values are `Output<T>`, not plain values. Show idiomatic `apply`, `pulumi.all([...]).apply(...)`, and interpolation for composing outputs, and why you must not `await`/log raw outputs expecting concrete values at define time.

3. **Async & ordering** — the right way to handle async in each language (TS promises, Python async, Go) without breaking Pulumi's dependency tracking, and why explicit dependencies come from output references, not execution order.

4. **Typing & structure** — idiomatic typing of component args/outputs, config objects, and shared interfaces so refactors are safe.

5. **Common anti-patterns** — imperative loops that create resources with unstable names, capturing outputs into control flow, and mutating shared state; show the correct pattern for each.

6. **Interop** — if teams use different languages, how to share via component packages or multi-language components so one library serves all.

Output as: (a) a language recommendation with rationale, (b) idiomatic Output<T> / apply / all examples in the chosen language, (c) an async-handling example, (d) a before/after of two anti-patterns, (e) a note on cross-language sharing if relevant.

Bias toward: leaning on `Output<T>` for dependencies, stable resource names, strong typing, and the language your team already ships confidently.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Pulumi prompts & error guides

Browse every Pulumi prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.