docs(import): refocus import guide on CLI-first and program-first (bulk) approaches#20080
Conversation
…lk) approaches Reframes the import resource guide around the two workflows users actually reach for today: CLI-first import of a single resource with `pulumi import`, and program-first (bulk) import, where `pulumi preview --import-file` generates an import file for an entire program (including components) that the user fills in and then applies with `pulumi import --file`. The existing bulk-import content (manual JSON authoring, the schema table, and the component walkthrough) is preserved but reordered so the generated-file workflow leads, since it is the one most users should reach for first. The `import` resource option is kept and explained for completeness, but is now explicitly framed as superseded by the two approaches above. Also fixes a broken anchor link (#how-import-works -> #where-to-find) found while restructuring, and adds a short cross-link from the components docs to the new program-first import section. Fixes #15053
Pre-merge Review — Last updated 2026-07-03T19:00:29ZTip Summary: This PR refactors the resource-import guide ( Review confidence:
Investigation log
🔍 Verification trail26 claims extracted · 25 verified · 0 unverifiable · 0 contradicted
🚨 Outstanding in this PRNo outstanding findings in this PR.
|
|
Your site preview for commit a8f117b is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-20080-a8f117bb.s3-website.us-west-2.amazonaws.com |
Fixes #15053
What changed
The import guide previously organized its two CLI-based workflows (single-resource import and bulk import from a JSON file) as if they were parallel-but-separate features, and buried the "generate an import file from a program" workflow — the one issue #15053 asks us to foreground — deep inside a "Bulk Import Operations" section, well after the code-based
importresource option.This restructures the page around the two approaches users actually reach for:
pulumi import <type> <name> <id>against a single resource, then copy the generated code into your program. Unchanged in substance, just retitled and reordered.pulumi preview --import-file <path>to generate an import file with names, URNs, and types already filled in, fill in the blankidfields, then runpulumi import --file <path>to import everything in one operation. This is now the lead workflow within the section, with the existing component-import walkthrough as its worked example.The pre-existing "author the JSON file by hand" workflow and the resource/schema reference table are preserved verbatim, just moved under a new "Authoring an import file by hand" subheading as an alternative to generating the file with
pulumi preview --import-file.The
importresource option keeps its full existing content (including the mismatched-state walkthrough) but is now explicitly framed as a third, older mechanism superseded by the two approaches above, per the issue.I also found and fixed a broken internal anchor link (
#how-import-works, which didn't exist) pointing it at the correct#where-to-findanchor, and added a short cross-link from the components concept page to the new program-first import section so readers building components know they can bulk-import them.Verification
I cross-checked the flag names against the authoritative, auto-generated CLI reference pages (
pulumi_import.mdandpulumi_preview.md) rather than inventing anything:pulumi import --file/-fandpulumi preview --import-fileboth match what's documented there. Front matter parses as valid YAML, Hugo shortcodes (chooser/choosable,notes) remain balanced exactly as in the original, and the file ends with a single trailing newline.🧠 This PR was created by workprentice on behalf of @joeduffy.