
Infrastructure as Code lets you manage and provision infrastructure through code. Terraform and its open-source fork, OpenTofu, are two of the common tools for it. As more teams adopt IaC, they need a way to automate runs, collaborate on changes, and keep some governance over what gets applied. Scalr is a platform built around Terraform and OpenTofu operations.
This post walks through Scalr's CI/CD features: GitOps workflows, custom hooks, run triggers, and ways to customize the execution environment.
Scalr automates Terraform and OpenTofu operations. It integrates with Version Control Systems (VCS) like Git, supporting GitOps workflows. Scalr supports two primary models:
plan and report the output. After review and merge into the main branch, Scalr proceeds with the apply operation. This model ensures that only approved code is applied to the infrastructure.Scalr's CI/CD automates standard Terraform/OpenTofu commands (init, plan, apply), reducing manual intervention and potential errors.
Most IaC workflows need a few steps that go beyond an automated plan and apply. Scalr's Custom Hooks let you run your own scripts and tools at different stages of a run, so you can shape the CI/CD process to fit how your team works.
Available hook points include:
plan operation. Used for static code analysis (e.g., tfsec, tflint), compliance checks, or generating dynamic input variables.plan has been generated. This can be used for custom plan analysis, cost estimation checks, or sending notifications about planned changes.apply operation. Used for final validation, integration with external approval systems, or security checks.Hook scripts can come from a VCS repository or be downloaded from an external location. Scalr also has a "hooks registry" for managing hooks in one place. A platform team can define standard hooks there and hand them to development teams, which keeps usage consistent across an organization.
Infrastructure components often depend on each other, so a change in one place needs to roll through to another. Scalr's Run Triggers handle those dependencies.
Run Triggers offer the following capabilities:
Scalr's cross-workspace run triggering is comparable to features in other platforms like Terraform Cloud (TFC) or Spacelift for managing infrastructure dependencies.
Not every team can run their workloads on shared, managed infrastructure. Scalr supports both managed execution and self-hosted agents (runners).
Self-hosted agents provide the following benefits:
With that control, Scalr can fit into setups that managed execution alone would not reach.
A Scalr workspace runs Terraform or OpenTofu. Its hooks, run triggers, and agent execution are all built around that engine, so the CI/CD workflow maps directly to Terraform and OpenTofu commands and run stages. As a drop-in Terraform Cloud alternative, Scalr gives teams a workflow purpose-built for Terraform and OpenTofu end to end.
Scalr automates and governs Terraform and OpenTofu workflows. The CI/CD pieces covered here (GitOps support, custom hooks, run triggers, and customizable execution environments) give teams a way to manage infrastructure as their automation needs grow more involved.
Further information is available in the Scalr documentation. A demo can be requested to view these features.
