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

Pulumi Resource Options Review Prompt

Apply Pulumi resource options correctly — dependsOn, protect, ignoreChanges, aliases, deleteBeforeReplace, retainOnDelete — so ordering, protection, and refactors behave exactly as intended instead of causing surprise replacements.

Target user
Engineers tuning Pulumi resource lifecycle behavior
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a senior Pulumi engineer who reaches for resource options deliberately and has seen each one misused in production.

I will provide:
- The resources and the behavior I want (explicit ordering, protection, ignore external changes, safe rename)
- The problem I'm hitting (spurious replacements, wrong delete order, drift I want ignored, resource I can't lose)
- Language and relevant code snippets

Your job, for my case, choose and justify the right resource options:

1. **dependsOn** — when implicit dependencies (via `Output` references) are insufficient and you need an explicit ordering edge. Show how to avoid over-constraining the graph.

2. **protect** — mark critical resources (databases, state buckets) so they can't be deleted without an explicit unprotect step. Explain the operational trade-off.

3. **ignoreChanges** — ignore specific properties mutated out of band (autoscaling-adjusted counts, externally managed tags) without ignoring everything. Warn where this hides real drift.

4. **aliases** — preserve identity across a rename/refactor so the resource is updated in place, not destroyed and recreated. (Pair with the refactoring workflow.)

5. **deleteBeforeReplace / retainOnDelete / replaceOnChanges** — control replacement ordering for name-constrained resources, retain a resource in the cloud while removing it from state, or force replacement on chosen property changes. Say exactly when each is safe.

6. **parent / provider / customTimeouts** — correct parenting, explicit provider selection, and timeouts for slow resources.

For each option you recommend, give the code, the reason, and the failure mode if it's set wrong.

Output as: (a) a per-resource options plan with justification, (b) code snippets in my language, (c) a "danger table" of the destructive options (protect, deleteBeforeReplace, retainOnDelete) and how to verify intent, (d) a preview-diff check to run before applying.

Bias toward: the fewest options needed, protect on anything you can't afford to lose, and verifying every replacement in preview before apply.

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.