Slack
Enhance your Terraform workflows with the Scalr Slack integration, enabling you to approve runs, review plans, and receive real-time drift detection alerts directly in your channels. Stop context switching and respond to critical infrastructure events faster to accelerate your deployment pipeline.
Overview
The Scalr integration for Slack pushes real-time notifications for key events in your Terraform and OpenTofu lifecycle directly to your designated Slack channels. This integration moves beyond simple alerts; it creates an interactive command center within Slack, allowing you to approve runs, review plan outputs, and monitor infrastructure health without context switching.
Configuring the Scalr Integration with Slack
Connecting the Scalr App to Slack
In order to list the channels, you must connect your Slack user to Scalr first, following the instructions from Scalr App in Slack. Only public and private channels you are a member of will be listed in Scalr. Additionally, for private channels to be shown, the Scalr bot must first be added to them in Slack.

Slack app catalog
Create the Slack Notification Configuration
First, find the Slack integration in the Scalr Accounts-> Integrations page. Once on the Slack integration, fill out the options presented:

Scalr Integration with Slack
Run modes:
- All runs: All Terraform runs, and when event conditions are met, will trigger a notification.
- Plan & apply runs: All Terraform runs that result in an apply, and when event conditions are met, will trigger a notification.
- Plan-only runs: All Terraform runs that are only plans (dry runs), and when event conditions are met, will trigger a notification.
Events:
- Approval required: This event covers standard Terraform or OpenTofu approval as well as Open Policy Agent overrides.
- Run finished successfully: This event is triggered when a run finishes successfully.
- Run errored: This event is triggered when a run fails.
- Drift detected: This event is triggered when Scalr detects drift in a run.
Environments & Workspaces
After the conditions are set, choose which Scalr environments and workspaces the rules should be applied to. If only the environment field is filled out, then all workspaces in the environment will trigger a notification.
Slack Notifications and Approvals
Terraform Run Notification
When the Slack notification is received, there will be an option to "Review run", which gives you the option to approve or decline it:

Scalr run notification in Slack
The first time a user goes through this workflow Scalr will authorize the bot for Slack. Once authorized, the bot will check that the person approving the run has the proper permission in Scalr to do so each time "Review run" is clicked. Once an action is taken, an optional reason can be given for the approve/deny and it will then appear in the run information in Scalr.
Terraform Drift Notification
When a Slack notification is received for drift, the users will be presented with three options:
- Ignore: Changes found by the drift detector are declined, and no further actions are performed. Users can choose to resolve the drift manually.
- Sync State: Changes found by the drift detector will be written to a state file. After clicking "Sync State", a refresh-only run will be triggered to synchronize the state. The runs:create permission is required.
- Revert Infrastructure: Changes found by the drift detector will be declined. After clicking "Revert Infra", a plan & apply run will be triggered to rollback infrastructure to the previous state. The runs:create permission is required.

Drift notification in Slack
Terraform Plan Output
Users also have the option of getting the full Terraform plan output directly in Slack by clicking "Get plan output". Once selected, the output will be sent in a private message through the Scalr app:

Terraform Plan Output in Slack
Example Configuration:
To send a notification to the #dev-team-approvals channel only when a Terraform apply to a workspace in the "Development" environment needs approval, you would configure:
- Channel ID: #dev-team-approvals
- Environments: Development
- Events: Approval required
- Run Mode: Plan & apply runs
Using the Scalr Provider
The Scalr Terraform provider can be used to manage the Slack integration. The full documentation for the provider can be found here.
resource "scalr_slack_integration" "test" {
name = "my-channel"
account_id = "acc-xxxxxxxxxx"
events = ["run_approval_required", "run_success", "run_errored"]
run_mode = "apply"
channel_id = "xxxxxxxxxx" # Can be found in slack UI (channel settings/info popup)
environments = ["env-xxxxxxxxxx"]
workspaces = ["ws-xxxxxxxxxx", "ws-yyyyyyyyyy"]
}
Demo
Updated 8 days ago