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
-
Pulumi Refactoring with Aliases Prompt
Refactor a Pulumi program — renaming, re-parenting, and moving resources between components — using aliases so changes update in place instead of destroying and recreating live infrastructure.
-
Pulumi Preview & Diff Review Prompt
Read a Pulumi preview like a code review — distinguishing safe updates from replacements and deletes — so a destructive change is caught in the plan instead of after the apply.
-
Pulumi Teardown Safety Prompt
Tear down Pulumi stacks safely — protecting stateful resources, ordering deletes, and backing up data first — so `pulumi destroy` cleans up ephemeral environments without nuking something irreplaceable.
-
Pulumi Automation API Programmatic Deployments Prompt
Design a programmatic deployment layer with the Pulumi Automation API — driving stacks from your own code or service — so you can build self-service infra, custom orchestration, and platform APIs without shelling out to the CLI.
More Pulumi prompts & error guides
Browse every Pulumi prompt and troubleshooting guide in one place.
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.