A run is the result of executing the Terraform deployment in a workspace. There are two types of runs, runs that include an apply and runs that exclude an apply, referred to as a dry run. All runs for a given workspace will be displayed in the runs tab. For VCS-driven runs, a commit hash is provided, which can be clicked on to help users understand what changes were made to the code prior to the deployment for the entire history of the workspace. CLI runs will be noted as CLI driven with the username of the person who created the run. This serves as a good way to audit the changes that have gone on within a workspace:

2194

Scalr will automatically kick off dry runs when a PR is opened against a branch that is linked to a Scalr workspace or if a user runs terraform plan through the CLI. If it is a VCS driven run, Scalr will report the checks back into your VCS provider.

1842

📘

Note

VCS driven dry runs are optional and can be enabled or disabled in the workspace settings.

Runs Queue

The runs queue page, which exists at the account scope and the environment scope, serves as a central dashboard for all runs across all workspaces. From this page, runs can be canceled in bulk or approved/discarded as needed. A use case for the bulk cancellation is to reprioritize runs (i.e. you have an emergency change going in that cannot wait on prior runs to finish).

2156

The permissions to view the runs page can be controlled through runs-queue:read in the IAM roles.

Target Resources

The target option gives users the ability to focus the Terraform run on a specific resource or set of resources:

1100

After target is checked, select the one or more resources that the run will impact once executed.

Schedule a Run

This is different than the Run Scheduler feature within the workspaces settings as this schedule is specific to a single run and set by clicking queue run:

1034

The schedule is set based on your browser timezone. Here are something considerations when using it:

  • The schedule does not change the run queue order for the workspace, runs are still queued in the order they were created.
  • The time set for plan/apply should be thought of as the earliest possible time the run can execute. The run could execute later depending on existing runs in the workspace that are in queue or running.
  • To avoid misuse of this feature or possible drift, only one scheduled run can be set per workspace.

Built-In Variables

The following shell variables are built into the runtime environment for use as needed:

  • SCALR_RUN_ID - The ID of the current run.
  • SCALR_HOSTNAME - The Scalr hostname.
  • SCALR_TERRAFORM_OPERATION - The current Terraform operation (plan or apply).
  • SCALR_TERRAFORM_EXIT_CODE - The exit code (0 or 1) of the previous operation (plan or apply) and only available in after hooks.

See the full documentation for variables here: Variables