Apply for invite to IaCP

scalr_current_run

Important

Only avaible in Scalr IaCP remote backend workspaces

This data source allows you to get information about the current Terraform run, including VCS (Git) metadata.

Syntax

data scalr_current_run example {
}

Arguments

No arguments required. This data source returns details of the current run.

Attributes

Attribute

Description

id

The ID of the run in run-xxxxxxxxxxx format.

environment_id

The ID of the environment in org-xxxxxxxxxxx format.

workspace_name

Workspace name.

vcs

Contains details of the VCS configuration if the workspace is linked to a VCS repo.

     repository_id

ID of the VCS repo in the for :user/:repo.

     branch

The linked VCS repo branch.

     commit

Details of the last commit to the linked VCS repo.

          message

Message for the last commit.

          sha

SHA of the last commit.

          author

Details of the commit author.

               email

email_address of author in the VCS.

               name

Name of author in the VCS.

               username

Username of author in the VCS.

is_destroy

Boolean indicates if this is a “destroy” run.

is_dry

Boolean indicates if this is a dry run, i.e. triggered by a Pull Request (PR). No apply phase if this is true.

message

Message describing how the run was triggered

source

The source of the run (VCS, tfe-api, Manual).

Example

data scalr_current_run default {
}

data scalr_workspace current {
  name         = data.scalr_current_run.default.workspace_name
  organization = data.scalr_current_run.default.environment_id
}