Pulumi "resource ... does not exist" drift in CI
Pulumi tried to read or update a resource its state says exists, but the cloud API reports it is gone. Something deleted the resource outside Pulumi, so state and reality have drifted apart.
What this error means
A pulumi up or pulumi refresh step fails with "error: resource 'X' does not exist" or a provider "NotFound" while operating on a resource in state.
pulumi
error: aws:ec2/instance:Instance resource 'web' does not exist;
the instance ID i-0abc123 was not foundCommon causes
The resource was deleted outside Pulumi
A console action, another tool, or a separate stack removed the resource, but Pulumi state still references it.
State points at a resource in another account or region
Credentials or region changed, so the resource exists elsewhere and is not found where Pulumi looks.
How to fix it
Refresh state to reconcile drift
- Run
pulumi refreshto update state to match the cloud. - Review what refresh proposes to remove from state.
- Re-run
pulumi upso the resource is recreated if the program still declares it.
Terminal
pulumi refresh --yes
pulumi up --yesConfirm credentials and region match the state
Ensure the job targets the same account and region the resource lives in so it is found.
Terminal
pulumi config set aws:region us-east-1How to prevent it
- Manage resources through Pulumi, not the console, to avoid drift.
- Run
pulumi refreshin CI before applying when drift is possible. - Keep credentials and region stable across runs.
Related guides
Pulumi "update failed" in CIFix Pulumi "error: update failed" in CI - one or more resource operations failed during `pulumi up`. The spec…
Pulumi "deleting ... resource ... still has dependents" in CIFix Pulumi "error: deleting ... resource ... still has dependents" in CI - a delete was blocked because other…
Pulumi "no stack named ... found" in CIFix Pulumi "error: no stack named X found" in CI - the CLI is logged into a backend or organization that does…