sample
turbot/flowpipe-samples/notify-on-call-engineer-with-pagerduty
Pipelines
0
Triggers
0
Variables
GitHub

Notify On-Call Engineer With PagerDuty

Allows anyone to see who is on-call for a particular escalation policy, send them an email, notify a Slack channel.

Installation

Download and install Flowpipe (https://flowpipe.io/downloads). Or use Brew:

brew tap turbot/tap
brew install flowpipe

Clone:

git clone https://github.com/turbot/flowpipe-samples.git
cd incident_response/notify_on_call_engineer_with_pagerduty

Install mod dependencies:

flowpipe mod install

Connections

By default, the following environment variables will be used for authentication:

  • PAGERDUTY_TOKEN
  • SENDGRID_API_KEY
  • SLACK_TOKEN

You can also create connection resources in configuration files:

vi ~/.flowpipe/config/pagerduty.fpc
connection "pagerduty" "pagerduty_conn" {
api_key = "u+_szhL..."
}
vi ~/.flowpipe/config/sendgrid.fpc
connection "sendgrid" "default" {
api_key = "SG.R6pHsRv..."
}
vi ~/.flowpipe/config/slack.fpc
connection "slack" "default" {
token = "xoxp-12345-..."
}

For more information on connections in Flowpipe, please see Managing Connections.

Usage

Run the pipeline and specify the slack_message, slack_channel, email_subject, email_text and from pipeline arguments:

flowpipe pipeline run notify_on_call_engineer_with_pagerduty \
--arg slack_message="On-call engineer" \
--arg slack_channel="CH12345ABC" \
--arg email_subject="On-call engineer" \
--arg email_text="On-call engineer" \
--arg from="foo@bar.com"