{"record":{"id":"ba3a7272df5308f5","repo":"pulumi/pulumi","slug":"no-plan-for-resource-v-ba3a72","errorCode":null,"errorMessage":"no plan for resource %v","messagePattern":"no plan for resource (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/deploy/step_generator.go","lineNumber":1389,"sourceCode":"\t\tnew.Inputs = inputs\n\t}\n\n\tif isTargeted {\n\t\tsg.queueUntargetedDependencySames(new)\n\t}\n\n\t// If the resource is valid and we're generating plans then generate a plan\n\tif !invalid && sg.deployment.opts.GeneratePlan {\n\t\tif recreating || wasExternal || sg.isTargetedReplace(urn, old) || old == nil {\n\t\t\toldInputs = nil\n\t\t}\n\t\tinputDiff := oldInputs.Diff(inputs)\n\n\t\t// Generate the output goal plan, if we're recreating or imported this it should already exist\n\t\tif recreating || imported {\n\t\t\tplan, ok := sg.deployment.newPlans.get(urn)\n\t\t\tif !ok {\n\t\t\t\treturn nil, false, fmt.Errorf(\"no plan for resource %v\", urn)\n\t\t\t}\n\t\t\t// The plan will have had it's Ops already partially filled in for the delete operation, but we\n\t\t\t// now have the information needed to fill in Seed and Goal.\n\t\t\tplan.Seed = randomSeed\n\t\t\tplan.Goal = NewGoalPlan(inputDiff, goal)\n\t\t} else {\n\t\t\tnewResourcePlan := &ResourcePlan{\n\t\t\t\tSeed: randomSeed,\n\t\t\t\tGoal: NewGoalPlan(inputDiff, goal),\n\t\t\t}\n\t\t\tsg.deployment.newPlans.set(urn, newResourcePlan)\n\t\t}\n\t}\n\n\t// If there is a plan for this resource, validate that the program goal conforms to the plan.\n\t// If theres no plan for this resource check that nothing has been changed.\n\t// We don't check plans if the resource is invalid, it's going to fail anyway.\n\tif !invalid && sg.deployment.plan != nil {","sourceCodeStart":1371,"sourceCodeEnd":1407,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/step_generator.go#L1371-L1407","documentation":"While computing an update's goal plan for a resource that is being recreated (replaced) or imported, the engine expects a pre-created entry in newPlans (created during the delete/recreate or import step). If none exists, the resource's output plan cannot be filled in (Seed and Goal) and the deployment fails. This is an internal invariant: recreation and import must have registered the plan earlier in the same deployment.","triggerScenarios":"During `pulumi preview --save-plan` (GeneratePlan), a resource marked as recreating or imported reaches the goal-plan stage but sg.deployment.newPlans has no entry for its URN — e.g. the delete side of a replacement didn't create the plan, or the import path skipped plan registration.","commonSituations":"Replacing resources with aliases where the recreate URN lookup misses; `pulumi import` combined with --save-plan; engine bugs in plan generation for edge cases (targeted replace, provider replacement).","solutions":["Upgrade the Pulumi CLI — plan generation edge cases (import/recreate) are commonly fixed in newer releases.","Avoid combining --save-plan with the triggering operation (e.g. do the import or targeted replace in a normal up, then generate a plan afterwards).","Check that aliases/URNs are unchanged so the recreate path finds the plan entry under the same URN.","File a reproducible issue with pulumi/pulumi if a simple replace triggers it on the latest CLI."],"exampleFix":"// before: importing while generating a plan\npulumi import aws.s3.Bucket b bucket-id --save-plan plan.json  # fails\n\n// after: separate the import from plan generation\npulumi import aws.s3.Bucket b bucket-id\npulumi preview --save-plan plan.json","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Automation API: fall back when plan generation hits recreate/import edge cases\ntry {\n    await stack.preview({ savePlan: \"plan.json\" });\n} catch (err) {\n    if (String(err).includes(\"no plan for resource\")) {\n        console.warn(\"Plan generation unsupported for this change; running normal preview.\");\n        await stack.preview();\n    } else { throw err; }\n}","preventionTips":["Keep the Pulumi CLI up to date when using --save-plan with replaces or imports.","Separate imports and targeted replaces from plan-generation deployments.","Preserve resource aliases/URNs so the recreate path finds existing plan entries."],"tags":["pulumi","plan-generation","step-generator"],"backgroundTag":"missing-resource-plan","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}