Slack
Integrating Spacelift with your favorite messaging platform
Last updated
Was this helpful?
Integrating Spacelift with your favorite messaging platform
Last updated
Was this helpful?
At Spacelift we're using Slack for internal communication. And we know that other tech companies do the same, so we've created a first class integration that we ourselves enjoy using.
As a Spacelift and Slack admin, you can link your Spacelift account to the Slack workspace by going to the Slack section of the Settings screen.
The integration is an OAuth2 exchange which installs Slack Spacelift app in your workspace.
Once you install the Spacelift app, the account-level integration is finished and the Slack section of the Settings screen informs you that the two are talking to one another:
Though before that happens, you need to allow requests coming from Slack to access Spacelift stacks.
Unlike HTTP requests, policy inputs representing Slack interactions replace "request"
and "session"
sections with a single "slack"
section, containing the following payload:
As you can see, that's quite a bit of data you can base your decisions on. For example, you can map some Slack channels as having certain level of access to certain Stacks - just make sure to keep these Slack channels private / invite-only. Here's an example stack access policy allowing Write level of access to requests coming from Slack's #dev-notifications channel:
Any Stack with this policy attached will be accessible for writing from this Slack channel - but no other!
Three slash commands are currently available:
/spacelift subscribe $stackId
- subscribes a particular Slack channel to run state changes for a given Stack - requires ;
/spacelift unsubscribe $stackId
- unsubscribes a particular Slack channel from run state changes for a given Stack;
/spacelift trigger $stackId
- triggers a tracked run for the specified Stack;
Installing the Slack app doesn't automatically cause Spacelift to flood your Slack channels with torrents of notifications. These are set up on a per-stack basis using and the management uses the Slack interface.
Similar to regular requests to our HTTP APIs, requests and actions coming from Slack are subject to the policy-based access validation. In this case, we're using . If you haven't had a chance to review the relevant documentation yet, please do it now before proceeding any further - you're risking a chance of getting lost.
For the most up-to-date explanation of Slack user intricacies, please always refer to .
Currently confirming and discarding tracked runs is available through the Slack interface. The ability to trigger those actions is subject to a check with a Write level on the user Slack info.