TrademarkTrademark
Features
Documentation

Chain Runs between workspaces using Run Triggers

Scalr now has an option to trigger a run in one workspace from a successful run in another workspace.
Ryan FeeJanuary 19, 2022
Chain Runs between workspaces using Run Triggers

Big news for Scalr users who have Terraform workspaces with a dependency on one another! Scalr has added an option to trigger a run in one workspace based on a successful run in another workspace.

Whatever your repository structure looks like, breaking Terraform deployments into smaller workspaces usually beats one massive multi-thousand resource workspace. Smaller workspaces deploy faster and are easier to troubleshoot. They also tend to depend on one another. Your components might need to apply in a specific order, or your production workspace might need to start once your non-production workspace has applied cleanly. You could script that today by calling the API or CLI, but that means maintaining extra code on top of the Terraform you've already written.

Run triggers handle this for you. They chain workspaces together into an orchestrated pipeline, so you don't have to.

The way these triggers work is straightforward. The downstream workspace waits for one or more upstream workspaces to have a successful run. As soon as the apply is finished, the downstream run will be triggered. If your downstream workspace is linked to more than one upstream, then a run will be triggered based on a successful run of any upstream workspace.

Run triggers are available for everyone. A soft quota applies to the number of triggers per account, and it can be raised free of charge on request. To set one up, go to a workspace and add one or more upstream workspaces.

Scalr workspace settings to add upstream workspaces for run triggers

See the full documentation here.

About the author
Ryan Feedirector of platform engineering at Scalr
Ryan Fee is the director of platform engineering at Scalr, with over 15 years of experience improving infrastructure experiences at companies large and small.