Skip to content

Slack bot that fetches user oncall given a schedule in PagerDuty

Notifications You must be signed in to change notification settings

schibsted/sls-oncall

Repository files navigation

sls-oncall

Slack bot that fetches user oncall given a schedule in PagerDuty.

Infrastructure

This version of the app was made in conjuntion with the Schibsted engineering article Slack bot with Serverless Framework.

Setup

Edit teams.json and add team name to schedule mappings

[
  {
    "name": "team-name",
    "schedules": ["P989K9X", "PYXYZ9N"],
    "tags": ["alternative-name"]
  }
]

Deployment

Make sure you have your credentials configured for the AWS CLI.

Before the first ever deploy in a environment, PagerDuty and Slack tokens need to be stored in AWS Parameter Store under AWS Systems Manager.

$ aws ssm put-parameter --region=eu-west-1 --name "/sls-oncall/pd-token" --type "SecureString" --value "<YOUR PD TOKEN>"
$ aws ssm put-parameter --region=eu-west-1 --name "/sls-oncall/slack-token" --type "SecureString" --value "<YOUR SLACK TOKEN>"
$ aws ssm put-parameter --region=eu-west-1 --name "/sls-oncall/slack-signsecret" --type "SecureString" --value "<YOUR SLACK SIGN SECRET>"

You also need to setup the Slack app and respond to the Slack challenge. Comment out async: true in the serverless.yml file and deploy. Once you have verified the url with Slack, comment it in and deploy again.

$ npx sls deploy --stage pro

Security

https://api.slack.com/docs/verifying-requests-from-slack

About

Slack bot that fetches user oncall given a schedule in PagerDuty

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published