1. Docs
  2. Pulumi CLI
  3. Commands
  4. pulumi destroy

pulumi destroy

    Destroy all existing resources in the stack

    Synopsis

    Destroy all existing resources in the stack, but not the stack itself

    Deletes all the resources in the selected stack. The current state is loaded from the associated state file in the workspace. After running to completion, all of this stack’s resources and associated state are deleted.

    The stack itself is not deleted. Use pulumi stack rm or the --remove flag to delete the stack and its config file.

    Warning: this command is generally irreversible and should be used with great care.

    pulumi destroy [flags]
    

    Options

          --config-file string                    Use the configuration values in the specified file rather than detecting the file name
      -d, --debug                                 Print detailed debugging output during resource operations
          --diff                                  Display operation as a rich diff showing the overall change
          --exclude-protected                     Do not destroy protected resources. Destroy all other resources.
      -h, --help                                  help for destroy
      -j, --json                                  Serialize the destroy diffs, operations, and overall output as JSON
      -m, --message string                        Optional message to associate with the destroy operation
      -p, --parallel int                          Allow P resource operations to run in parallel at once (1 for no parallelism). (default 16)
          --preview-only                          Only show a preview of the destroy, but don't perform the destroy itself
      -r, --refresh string[="true"]               Refresh the state of the stack's resources before this update
          --remove                                Remove the stack and its config file after all resources in the stack have been deleted
          --show-config                           Show configuration keys and variables
          --show-replacement-steps                Show detailed resource replacement creates and deletes instead of a single step
          --show-sames                            Show resources that don't need to be updated because they haven't changed, alongside those that do
      -f, --skip-preview                          Do not calculate a preview before performing the destroy
      -s, --stack string                          The name of the stack to operate on. Defaults to the current stack
          --suppress-outputs                      Suppress display of stack outputs (in case they contain sensitive values)
          --suppress-permalink string[="false"]   Suppress display of the state permalink
          --suppress-progress                     Suppress display of periodic progress dots
      -t, --target stringArray                    Specify a single resource URN to destroy. All resources necessary to destroy this target will also be destroyed. Multiple resources can be specified using: --target urn1 --target urn2. Wildcards (*, **) are also supported
          --target-dependents                     Allows destroying of dependent targets discovered but not specified in --target list
      -y, --yes                                   Automatically approve and perform the destroy after previewing it
    

    Options inherited from parent commands

          --color string                 Colorize output. Choices are: always, never, raw, auto (default "auto")
      -C, --cwd string                   Run pulumi as if it had been started in another directory
          --disable-integrity-checking   Disable integrity checking of checkpoint files
      -e, --emoji                        Enable emojis in the output
          --logflow                      Flow log settings to child processes (like plugins)
          --logtostderr                  Log to stderr instead of to files
          --memprofilerate int           Enable more precise (and expensive) memory allocation profiles by setting runtime.MemProfileRate
          --non-interactive              Disable interactive mode for all commands
          --profiling string             Emit CPU and memory profiles and an execution trace to '[filename].[pid].{cpu,mem,trace}', respectively
          --tracing file:                Emit tracing to the specified endpoint. Use the file: scheme to write tracing data to a local file
      -v, --verbose int                  Enable verbose logging (e.g., v=3); anything >3 is very verbose
    

    SEE ALSO

    Auto generated by spf13/cobra on 16-Mar-2024
      Pulumi AI - What cloud infrastructure would you like to build? Generate Program