LinuxCommandLibrary

pulumi-cancel

Cancel a running Pulumi update

TLDR

Cancel a stack's currently running update, if any

$ pulumi cancel [stack_name]
copy

Skip confirmation prompts, and proceed with cancellation anyway
$ pulumi cancel [[-y|--yes]]
copy

Display help
$ pulumi cancel [[-h|--help]]
copy

SYNOPSIS

pulumi cancel <stack-name> [options]

PARAMETERS

<stack-name>
    The name of the stack whose pending update or operation you wish to cancel. This is a required positional argument.

--yes, -y
    Skip confirmation prompts and proceed directly with the cancellation. Use with caution, especially in automated scripts.

--message <string>
    An optional message to associate with the cancellation, which will be recorded in the stack's history.

--stack <string>
    The name of the stack to operate on. Can be used as an alternative to the positional argument <stack-name>, or to explicitly specify a stack different from the current one.

--debug
    Enable verbose debug logging for the command's execution.

--json
    Emit output as JSON, suitable for programmatic consumption.

--help
    Display help information for the pulumi cancel command.

DESCRIPTION

The pulumi-cancel command is used to terminate an ongoing Pulumi deployment operation, such as an update, destroy, or refresh. This is particularly useful if a deployment is stuck, taking an unexpectedly long time, or was initiated by mistake.

Upon execution, pulumi-cancel attempts to signal the Pulumi engine to stop the current operation and mark the stack's state as 'cancelled'. It does not automatically roll back any changes that have already occurred, meaning resources might be left in a partially deployed or inconsistent state. Subsequent pulumi update commands would then attempt to reconcile the stack to its desired state based on the current program. By default, it prompts for confirmation unless the --yes flag is provided.

CAVEATS

1. Partial State: Cancelling an operation may leave your cloud resources in a partially deployed or inconsistent state. pulumi-cancel does not automatically roll back changes; it only stops the ongoing process.
2. Best Effort: Cancellation is a best-effort attempt. Depending on the state of the operation and the cloud provider, it might take some time for the process to fully stop, or resources might continue to be created/deleted briefly.
3. Confirmation: By default, the command prompts for confirmation. To bypass this, use the --yes or -y flag, which is useful for scripting but should be used carefully.

HISTORY

The pulumi-cancel command has been a core part of the Pulumi CLI since its early versions, introduced to provide users with essential control over long-running or stuck deployments. It addresses the critical need to gracefully terminate operations that might otherwise consume excessive time or lead to unexpected resource provisioning, thus enhancing the reliability and manageability of infrastructure as code deployments.

SEE ALSO

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

Copied to clipboard