LinuxCommandLibrary

pulumi-down

Tear down Pulumi infrastructure

TLDR

View documentation for the original command

$ tldr pulumi destroy
copy

SYNOPSIS

pulumi-down [flags]

PARAMETERS

--yes
    Skip confirmation prompts before destroying resources.

--config-file
    Load configuration values from the specified file.

--cwd


    Run pulumi as if in the specified directory.

--stack
    The name of the stack to destroy. Defaults to the current stack.

--message
    Commit message to associate with the destruction operation.

--target
    Specify a single resource to destroy by its URN (Pulumi Resource Name).

--target-dependents
    Automatically include resources that are dependent on the target resource in the destruction plan.

--parallel
    Allow up to `int` resource operations to run in parallel (default is unbounded).

--policy-pack
    Run one or more policy packs as part of this update.

--refresh
    Refresh the state of the stack before performing the destruction.

--remove
    Remove the stack after it has been destroyed.

DESCRIPTION

The `pulumi-down` command is used to destroy all resources in a Pulumi stack. It performs the reverse operation of `pulumi-up`, tearing down the infrastructure provisioned by the Pulumi program. This process involves deleting the deployed resources in the cloud provider (e.g., AWS, Azure, GCP) managed by the stack. The command reads the current stack's state from the Pulumi state file (usually stored in a backend like Pulumi Cloud or a cloud object storage bucket) to determine which resources were previously created and need to be removed. It's crucial to understand that this action is destructive and all data and infrastructure associated with the stack will be permanently deleted. Before executing `pulumi-down`, it's highly recommended to review the plan to ensure you are deleting the intended resources. It also requires you to have the same cloud provider credentials configured as when the stack was created. Failures during the destruction process can lead to partial deletion and may require manual intervention to clean up remaining resources.

CAVEATS

Irreversible data loss. Always double-check the plan before confirming.
Ensure correct cloud provider credentials are configured.

ERROR HANDLING

Pulumi provides detailed error messages during the `pulumi-down` process. These errors often point to issues with resource deletion, dependency conflicts, or permission problems.
Inspecting these errors carefully is crucial for troubleshooting destruction failures. For complex deployments, it might require manual intervention in the cloud provider's console to resolve stuck or failed resource deletions.

STACK LOCKING

Pulumi automatically locks the stack during the `pulumi-down` operation to prevent concurrent modifications. If a stack is already locked by another process, `pulumi-down` will wait until the lock is released before proceeding. If you encounter a situation where a stack is indefinitely locked due to a crashed or interrupted process, you might need to manually unlock the stack using `pulumi stack unlock` after careful consideration.

CONFIGURATION

Configuration values are managed with `pulumi config`. When running `pulumi-down`, the configuration values that were present when resources were created are used to determine the resources to remove.
You can temporarily change the configuration for `pulumi-down` execution. However, such modification will most likely lead to errors.

HISTORY

The `pulumi-down` command has been developed alongside the Pulumi infrastructure-as-code platform. Its purpose is to provide a clean, declarative way to decommission and deprovision infrastructure managed by Pulumi. It reflects the core principle of Pulumi, which is to manage infrastructure with code and have it destroyed in a similar declarative way.

SEE ALSO

Copied to clipboard