pulumi-cli

Recover Pulumi stacks and manage state with CLI operations.

19|3|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/dirien/yet-another-agent-harness --skill pulumi-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pulumi-cli
Source: https://github.com/dirien/yet-another-agent-harness/tree/main/.claude/skills/pulumi-cli
Command: npx skills add https://github.com/dirien/yet-another-agent-harness --skill pulumi-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Pulumi CLI operations can leave stacks in inconsistent or stuck states, and managing state changes, migrations, and non-interactive CI deployments is error prone. This guide focuses on operational tasks—recovering interrupted updates, repairing corrupt state, moving resources between stacks, and safely importing or exporting state—so you can restore stability without unintended resource recreation or data loss.

Core Features & Use Cases

  • Clear pending or stuck operations and resume deployments using refresh, cancel, and state repair patterns.
  • Move, rename, import, or delete resources from state to avoid destructive cloud operations while preserving live resources.
  • Backup and restore state, migrate backends, and perform atomic state moves between stacks for refactoring or environment changes.
  • CI/CD automation guidance: required environment variables, non-interactive flags, and safe pipeline steps for preview and deploy.
  • Protect critical resources and enforce safe workflows with state protection, previews, and best-practice backups.

Quick Start

Recover a stack stuck with pending operations by running a refresh with clear pending creates, canceling the running update if necessary, exporting a backup of the current state, and then applying state repair or import as appropriate.

Frequently Asked Questions about pulumi-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover a Pulumi stack stuck with pending operations?

To recover a Pulumi stack with pending operations, run a refresh to clear pending creates, cancel any in-flight updates, and export a backup before applying state repair. This resolves interrupted deployments without recreating cloud resources.

Can I move resources between Pulumi stacks without destroying them?

Yes, you can move resources between Pulumi stacks without destroying them by exporting the state, modifying the state file to move or rename resources, and importing it into the target stack. This preserves live cloud resources during refactoring.

What environment variables do I need for non-interactive Pulumi CI/CD workflows?

For non-interactive Pulumi CI/CD workflows, you need to set the PULUMI_ACCESS_TOKEN, PULUMI_CI, and PULUMI_SKIP_UPDATE_CHECK environment variables. These enable safe automated pipeline steps for preview and deploy without interactive prompts.

How do I export and import Pulumi state to repair corrupt infrastructure-as-code deployments?

You export and import Pulumi state to repair infrastructure-as-code deployments by using state export to back up the current state, modifying the JSON to remove orphans, and using state import to restore the stack safely.

What is the best way to protect critical Pulumi resources from accidental deletion during updates?

The best way to protect critical Pulumi resources from accidental deletion during updates is to enable resource protection and enforce safe workflows with state protection, previews, and best-practice backups. This prevents unintended data loss during deployments.