scalr_run_trigger

Resource: scalr_run_trigger

Run triggers are a way to chain workspaces together. The use case for this is that you might have one or more upstream workspaces that need to automatically kick off a downstream workspace based on a successful run in the upstream workspace. To set a trigger, go to the downstream workspace and set the upstream workspace(s). Now, whenever the upstream workspace has a successful run, the downstream workspace will automatically start a run.

Example Usage

data "scalr_workspace" "downstream" {
  name           = "downstream"
  environment_id = "env-xxxxxxxxxx"
}

data "scalr_workspace" "upstream" {
  name           = "upstream"
  environment_id = "env-xxxxxxxxxx"
}

resource "scalr_run_trigger" "set_downstream" {
  # run automatically triggered in this workspace once the run in the upstream workspace is applied
  downstream_id = data.scalr_workspace.downstream.id
  upstream_id   = data.scalr_workspace.upstream.id
}

Schema

Required

  • downstream_id (String) The identifier of the workspace in which new runs will be triggered.
  • upstream_id (String) The identifier of the upstream workspace.

Read-Only

  • id (String) The ID of this resource.

Import

Import is supported using the following syntax:

terraform import scalr_run_trigger.example rt-xxxxxxxxxx