Slack
Infracost Cloud Guardrails have native support for Slack notifications that trigger when your defined thresholds are exceeded. If you are not using that feature, you can post cost estimates to Slack by following these steps in your CI/CD system:
- Create a Slack Webhook in your workspace.
- Use the
infracost output --format slack-message
command to produce a Slack-flavored Markdown message. Slack message blocks have a 3000 char limit so the Infracost CLI automatically truncates the middle of theslack-message
output format if required. - Post the message to Slack using
curl
from your CI/CD system. See this example for how to do this in GitLab, the same bash commands can be used in other systems.
If you run into any issues, please join our community Slack channel, we'll help you very quickly 😄