https://infracost.io logo
#general
Title
# general
m

millions-optician-95381

06/03/2021, 3:08 PM
Dose Infracost support sending notifications to slack, for example, can we output a format for slack, and send it using curl or webhooks?
w

white-airport-8778

06/03/2021, 3:11 PM
Hey Yahya! not yet, but someone else asked for it before too, can you possibly share a little about your use-case? would you want it to post the same diff message it outputs in pull requests?
m

millions-optician-95381

06/07/2021, 6:39 AM
the idea to have rich output with slack formating, so send summary in PR and in Slack, developers check PRs and FinOps check a slack channel.
w

white-airport-8778

06/07/2021, 9:50 AM
@millions-optician-95381 here’s an MVP: https://github.com/infracost/infracost/pull/781 🙂 Which CI/CD integration are you using? Based on that I can decide how to release this MVP to unblock you. You’d only need to add an env var for the webhook, e.g.
SLACK_WEBHOOK_URL=<https://hooks.slack.com/services/>...
There’s a lot more we can do, e.g. add the repo URL and improve the formatting, but maybe you can use this to see what the FinOps team wants to see in the Slack message?
m

millions-optician-95381

06/07/2021, 10:36 AM
awesome,,,
Github Actions
w

white-airport-8778

06/07/2021, 10:40 AM
@millions-optician-95381 cool, I’ll create a test docker image so you can test it and if it works ok, i’ll merge it 🙂 2mins…
Done! To use it: 1. Create a new GH Secret with the Slack Webhook URL. 2. Update your
.github/workflows/infracost.yml
file to change:
Copy code
uses: infracost/infracost-gh-action@master
to:
Copy code
uses: infracost/infracost-gh-action@test
env:
  SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Plz lmk if this works ok and I’ll merge it to master.
m

millions-optician-95381

06/07/2021, 11:39 AM
ok, I will test this asap
👍 1
6 Views