LinuxCommandLibrary

pulumi-down

Tear down Pulumi infrastructure

TLDR

View documentation for the original command

$ tldr pulumi destroy
copy

SYNOPSIS

pulumi down [options]
pulumi destroy [options]

PARAMETERS

--stack
    Specify the stack to operate on. If omitted, the currently selected stack is used.

--yes
    Skip prompt for confirmation and proceed directly with resource destruction. Use with caution.

--target
    Target a specific resource (by its URN) for destruction. Can be specified multiple times to target multiple resources. Only these resources and their dependencies will be affected.

--target-dependents
    Destroy dependents of targeted resources as well, in addition to the targeted resources themselves.

--message
    An optional message to associate with the destruction operation, recorded in the stack history.

--non-interactive
    Disable interactive prompts, useful for automated scripts or CI/CD pipelines.

--skip-preview
    Skip the preview step and directly attempt to destroy resources after confirmation (or with --yes).

--parallel
    Allow N resource operations (creates, updates, deletes) to run in parallel. Defaults to a reasonable number.

--color
    Control colored output. Options include always, never, auto.

--debug
    Enable verbose debug logging output.

DESCRIPTION

The pulumi down command is used to permanently destroy all resources provisioned by a specific Pulumi stack. It is an essential part of the infrastructure lifecycle management, enabling users to deprovision cloud resources, clean up environments, and reduce cloud costs. Before executing the destruction, pulumi down performs a preview, showing which resources will be deleted and prompting for user confirmation by default. This crucial safety mechanism helps prevent accidental data loss or infrastructure teardown. Pulumi intelligently determines the correct order of resource destruction based on their dependencies, ensuring a clean and complete deprovisioning. Users must have appropriate cloud provider permissions for resource deletion. Once completed, the resources are irrevocably removed from the cloud provider.

CAVEATS

  • Irreversible Operation: pulumi down permanently deletes cloud resources. This action cannot be undone. Always review the preview carefully.
  • State Management: The command relies on the Pulumi state file to know which resources to destroy. If the state is out of sync with the actual cloud resources, unintended results or orphaned resources may occur.
  • IAM Permissions: The executing user or service principal must possess the necessary Identity and Access Management (IAM) permissions within the cloud provider to delete all targeted resources.
  • External Modifications: If resources managed by Pulumi have been modified or deleted outside of Pulumi, the down operation might fail or leave resources behind. A pulumi refresh beforehand can help reconcile the state.

CONFIRMATION PROMPT

By default, pulumi down requires explicit confirmation (typing 'yes' at a prompt) before proceeding with the destruction. This is a vital safety mechanism designed to prevent accidental deletion of critical infrastructure. The --yes flag can be used to bypass this prompt, but it should be used with extreme caution, especially in production environments.

RESOURCE DEPENDENCIES

Pulumi's engine intelligently analyzes the dependencies between resources defined in your program. When executing pulumi down, it determines the correct order to tear down resources, ensuring that dependent resources are removed before their dependencies. This prevents errors that could arise from trying to delete resources that are still in use.

HISTORY

Pulumi, as an Infrastructure as Code (IaC) platform, was publicly launched in 2018, aiming to bring familiar programming languages and tools to cloud infrastructure management. The down command, often synonymous with destroy, has been a core and fundamental part of the Pulumi CLI since its earliest versions. It addresses the critical need for a controlled and auditable process to deprovision and clean up cloud resources, complementing the deployment (up) and preview workflows. Its design emphasizes safety, with mandatory confirmation prompts and intelligent dependency resolution, reflecting best practices in cloud resource lifecycle management.

SEE ALSO

pulumi up(1), pulumi preview(1), pulumi refresh(1), pulumi stack rm(1)

Copied to clipboard