Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 24 additions & 33 deletions website/docs/cloud-docs/run/manage.mdx
Original file line number Diff line number Diff line change
@@ -1,83 +1,74 @@
---
page_title: Viewing and Managing Runs - Runs - Terraform Cloud and Terraform Enterprise
description: >-
Workspaces list current, pending, and historical runs. Learn to view run
Workspaces list current, pending, and historical runs. View run
information and lock workspaces to prevent new runs.
---

# Viewing and Managing Runs

Each workspace in Terraform Cloud includes a list of its current, pending, and historical runs. You can view information about these runs in the UI, and sometimes interact with them.
Each workspace in Terraform Cloud includes a list of its current, pending, and historical runs. You can view and interact with these runs in the UI. You can also lock workspaces to temporarily prevent new runs.

Additionally, you can lock workspaces to temporarily prevent new runs.
## API

-> **API:** See the [Runs API](/cloud-docs/api-docs/run) and [lock a Workspace endpoint](/cloud-docs/api-docs/workspaces#lock-a-workspace).
Refer to the [Runs API](/cloud-docs/api-docs/run) and [lock a Workspace endpoint](/cloud-docs/api-docs/workspaces#lock-a-workspace).

## Navigating Runs

Each workspace has two ways to view and navigate runs:
Go to the workspace and click the **Runs** tab to review a list of all current and past Terraform runs.

- A "Runs" link, which goes to the full list of runs.
- A "Current Run" link, which goes to the most recent active run. (This might not be the most recently initiated run, since runs in the "pending" state remain inactive until the current run is completed.)

![runs list](/img/docs/runs-list.png)

From the list of runs, you can click to view or interact with an individual run.

### The Run Page

An individual run page shows the progress and outcomes of each stage of the run.

![a run page](/img/docs/runs-run-page.png)

Most importantly, it shows:
Click a run to go to its details page. The details page contains the following information:

- The current status of the run.
- The code commit associated with the run.
- How the run was initiated, when, and which user initiated it (if applicable).
- How the run initiated, when, and which user initiated it (if applicable).
- A timeline of events related to the run.
- The output from both the `terraform plan` and `terraform apply` commands, if applicable. You can hide or reveal these as needed; they default to visible if the command is currently running, and hidden if the command has finished.
- The output from both the `terraform plan` and `terraform apply` commands, if applicable. This output defaults to visible if the command is currently running and hidden if the command has finished.

## Interacting with Runs

In workspaces where you have permission to apply runs, run pages include controls for interacting with the run at the bottom of the page. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions)) Depending on the state of the run, the following buttons might be available:
In workspaces where you have [permission to apply runs](/cloud-docs/users-teams-organizations/permissions#general-workspace-permissions), you can interact with a run at the bottom of its details page.

The following options are available, depending on the state of the run:

| Button | Available when: |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Add Comment | Always. |
| Confirm & Apply | A plan needs confirmation. |
| Override & Continue | A soft-mandatory policy failed. Requires permission to manage policy overrides for the organization. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions)) |
| Override & Continue | A soft-mandatory policy failed. Requires permission to manage policy overrides for the organization. |
| Discard Run | A plan needs confirmation or a soft-mandatory policy failed. |
| Cancel Run | A plan or apply is currently running. |
| Force Cancel Run | A plan or apply was canceled, but something went wrong and Terraform Cloud couldn't end the run gracefully. Requires admin access to the workspace. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions)) |
| Force Cancel Run | A plan or apply canceled, but Terraform Cloud was unable to end the run. Requires admin access to the workspace. |
| Retry Run | A plan-only run has finished. You can also change which Terraform version to use when retrying a plan-only run. |

[permissions-citation]: #intentionally-unused---keep-for-maintainers

If a plan needs confirmation (with [manual apply](/cloud-docs/workspaces/settings#auto-apply-and-manual-apply) enabled) or a soft-mandatory policy failed, the run will remain paused until a user with appropriate permissions uses these buttons to continue or discard the run. For more details, see [Run States and Stages](/cloud-docs/run/states).
If a plan needs confirmation (with [manual apply](/cloud-docs/workspaces/settings#auto-apply-and-manual-apply) enabled) or a soft-mandatory policy failed, the run remains paused until a user with appropriate permissions uses these buttons to continue or discard the run. Refer to [Run States and Stages](/cloud-docs/run/states) for more details.

### Canceling Runs

If a run is currently planning or applying, users with permission to apply runs for the workspace can cancel the run before it finishes, using the "Cancel Run" button on the run's page. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions))
If a run is currently planning or applying, users with [permission to apply runs](/cloud-docs/users-teams-organizations/permissions#general-workspace-permissions) for the workspace can click **Cancel Run** to stop the run before it finishes.

[permissions-citation]: #intentionally-unused---keep-for-maintainers

Canceling a run is roughly equivalent to hitting ctrl+c during a Terraform plan or apply on the CLI. The running Terraform process is sent an INT signal, which instructs Terraform to end its work and wrap up in the safest way possible. (This gives Terraform a chance to update state for any resources that have already been changed, among other things.)
Canceling a run is roughly equivalent to typing `ctrl+c` during a Terraform plan or apply on the CLI. The running Terraform process is sent an INT signal, which instructs Terraform to end its work, update state for any resources that have already been changed, and wrap up in the safest way possible.

In rare cases, a cancelled run can fail to end gracefully, and will continue to lock the workspace without accomplishing anything useful. These stuck runs can be **force-canceled,** which immediately terminates the running Terraform process and unlocks the workspace.
In rare cases, a canceled run can fail to end, continuing to lock the workspace. You can forcefully cancel these runs, which immediately terminates the running Terraform process and unlocks the workspace.

Since force-canceling can have dangerous side-effects (including loss of state and orphaned resources), it requires admin access to the workspace. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions)) Additionally, the "Force Cancel Run" button only appears after the normal cancel button has been used and a cool-off period has elapsed, to ensure Terraform Cloud has a chance to terminate the run safely.
Force-canceling requires admin access to the workspace because it can have dangerous side-effects, including loss of state and orphaned resources. Additionally, the **Force Cancel Run** button only appears after you click **Cancel Run** and Terraform Cloud has time to terminate the run safely.

[permissions-citation]: #intentionally-unused---keep-for-maintainers

## Locking Workspaces (Preventing Runs)

If you need to temporarily stop runs from being queued, you can lock the workspace.
You can lock the workspace to temporarily stop runs from being queued. Locking a workspace requires [permission to lock and unlock the workspace](/cloud-docs/users-teams-organizations/permissions#general-workspace-permissions).

A lock prevents Terraform Cloud from performing any plans or applies in the workspace. This includes automatic runs due to new commits in the VCS repository, manual runs queued via the UI, runs started on the command line with `terraform plan` and `terraform apply`, and runs created with the API. New runs remain in the "Pending" state until the workspace is unlocked.
A lock prevents Terraform Cloud from performing any plans or applies in the workspace. This lock includes automatic runs due to new commits in the VCS repository, manual runs queued via the UI, runs started on the command line with `terraform plan` and `terraform apply`, and runs created with the API. New runs remain in the **Pending** state until the workspace unlocks.

The current lock status is shown in the workspace header, near the "Actions" menu.
Terraform Cloud shows the lock status in the workspace's header, next to the **Actions** menu.

You can find the lock button in the "Actions" menu in a workspace's header, or in [the workspace settings page](/cloud-docs/workspaces/settings). Locking a workspace requires permission to lock and unlock the workspace. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions))
To lock or unlock a workspace, do one of the following:
- Open the **Actions** menu and select **Lock workspace** or **Unlock workspace**.
- Go to **Settings > Locking**.

[permissions-citation]: #intentionally-unused---keep-for-maintainers
Binary file removed website/img/docs/runs-list.png
Binary file not shown.
Binary file removed website/img/docs/runs-run-page.png
Binary file not shown.