Pulumi Import of Existing Resources Prompt
Bring existing cloud resources under Pulumi management with pulumi import — generating code and adopting state — so clickops and legacy infrastructure become IaC without downtime or recreation.
- Target user
- Engineers adopting brownfield infrastructure into Pulumi
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior engineer who has adopted large brownfield estates into Pulumi and knows import goes wrong quietly, not loudly. I will provide: - The existing resources to import (created by clickops, scripts, or another tool) and their cloud/provider - Their IDs or how to discover them, and my Pulumi language/stack - Volume: a handful vs hundreds of resources - Whether these resources have dependencies on each other Your job: 1. **Plan the import** — decide the order (foundational resources first: networks, then dependents) and whether to use single `pulumi import`, a bulk import file, or `import` resource options in code. 2. **Generate & clean code** — use import to generate resource definitions, then explain what to fix: correct provider/version, adjust generated names to your convention, and remove read-only/computed properties that would cause diffs. 3. **Reach zero-diff** — the goal after import is a `pulumi preview` that shows no changes. Show how to reconcile every spurious diff (property mismatches, defaults, ignoreChanges) until the resource is faithfully represented. 4. **Handle dependencies** — import dependent resources with correct references (parent, provider) so the graph matches reality and delete ordering is right. 5. **Secrets & drift** — mark imported secret values as secret, and note where the imported resource may drift from code if others still modify it out of band. 6. **Verify & lock in** — after zero-diff is achieved, add `protect` where appropriate and commit, so the now-managed resource can't be accidentally destroyed. Output as: (a) the ordered import plan, (b) the import commands / bulk import file, (c) a before/after of generated vs cleaned resource code, (d) the zero-diff reconciliation checklist, (e) the post-import protection and verification steps. Bias toward: import over recreate, a verified zero-diff preview before declaring success, and protecting critical imported resources immediately.
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
-
Migrating from Terraform to Pulumi Prompt
Plan a Terraform-to-Pulumi migration — convert with tf2pulumi, adopt existing state, or run both side by side — so you move to real-language IaC without recreating live infrastructure.
-
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 Drift Detection Prompt
Set up Pulumi drift detection with refresh and scheduled checks so out-of-band changes to your infrastructure are caught, triaged, and reconciled before they cause an incident.
-
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.