scalr_current_run

Data Source: scalr_current_run

Allows you to get information about the current Terraform run when using a Scalr remote backend workspace, including VCS (Git) metadata.

No arguments are required. The data source returns details of the current run based on the SCALR_RUN_ID shell variable that is automatically exported in the Scalr remoted backend.

Example Usage

data "scalr_current_run" "example" {}

Schema

Read-Only

  • environment_id (String) The ID of the environment, in the format env-<RANDOM STRING>.
  • id (String) The ID of the run, in the format run-<RANDOM STRING>.
  • is_destroy (Boolean) Boolean indicates if this is a "destroy" run.
  • is_dry (Boolean) Boolean indicates if this is a dry run, i.e. triggered by a Pull Request (PR). No apply phase if this is true.
  • message (String) Message describing how the run was triggered.
  • source (String) The source of the run (VCS, API, Manual).
  • vcs (Block List) Contains details of the VCS configuration if the workspace is linked to a VCS repo. (see below for nested schema)
  • workspace_name (String) Workspace name.

Nested Schema for vcs

Read-Only:

  • branch (String) The linked VCS repo branch.
  • commit (List of Object) Details of the last commit to the linked VCS repo. (see below for nested schema)
  • repository_id (String) ID of the VCS repo in the format :org/:repo.

Nested Schema for vcs.commit

Read-Only:

Nested Schema for vcs.commit.author

Read-Only:

  • username (String)