Restoring deleted stacks
Pulumi Cloud retains the state file versions of recently deleted stacks so that organization administrators can recover them through the Pulumi Cloud console. This is useful when a stack is deleted accidentally — most often by pulumi stack rm --force, which removes the state file even when the stack still has resources associated with it — or when a stack was intentionally deleted but its activity history is later needed.
What gets restored
When you restore a deleted stack, Pulumi Cloud restores the stack’s state file and update history. Restoring a stack does not re-create any cloud resources that were destroyed by a prior pulumi destroy; it only brings back the stack record and its state so you can resume managing it from Pulumi.
If the stack was deleted with pulumi stack rm --force while resources still existed, the cloud resources themselves were not deleted — they were orphaned. Once you restore the stack, those resources are again represented in state and you can manage them with Pulumi as before.
Limits
- Only the last 25 deleted stacks in an organization are available for self-service restore.
- Only organization administrators can restore stacks.
- If you need to restore an older stack that is no longer in the list, contact Pulumi support.
Restore a stack
- Sign in to the Pulumi Cloud console as an organization administrator and select the organization the stack belonged to.
- Navigate to the Stacks page for the organization.
- Next to the Create project button, open the three-dot menu and choose Restore stacks.
- Locate the stack you want to restore in the list of recently deleted stacks and select Restore.
After the stack is restored, it appears in the organization’s stack list with its prior state and history.
Avoiding accidental deletion
The restore window is finite, so the best protection against accidental loss is preventing the deletion in the first place:
- Prefer
pulumi stack rm(without--force) so the CLI refuses to remove a stack that still has resources tracked in state. Usepulumi destroyfirst, confirm the stack is empty, and then remove it. - Reserve
pulumi stack rm --forcefor cases where you have intentionally decided to orphan the underlying cloud resources or where you are certain the state file does not need to be preserved. - For stacks that should never be removable through routine operations, restrict who has organization-admin or stack-write permissions. See Teams and RBAC.
Related
- Stacks — concept reference, including how to delete a stack.
- Editing state files — safe techniques for modifying state when normal operations cannot recover.
- Troubleshooting — diagnosing and resolving common Pulumi failures.
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.