Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkr2017/emr-slack-notify
AWS Lambda function to send EMR events to Slack via SNS
https://github.com/rkr2017/emr-slack-notify
aws aws-lambda cloudwatch-events emr emr-cluster lambda-functions slack
Last synced: 3 months ago
JSON representation
AWS Lambda function to send EMR events to Slack via SNS
- Host: GitHub
- URL: https://github.com/rkr2017/emr-slack-notify
- Owner: rkr2017
- Created: 2017-11-29T13:39:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-30T10:34:03.000Z (almost 7 years ago)
- Last Synced: 2024-05-29T00:23:00.142Z (5 months ago)
- Topics: aws, aws-lambda, cloudwatch-events, emr, emr-cluster, lambda-functions, slack
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# emr-slack-notify
##### This function is to send the EMR Events captured by CloudWatch Events service `via SNS` to a public Slack channel using the Incoming WebHooks feature## Setup
1. Create a NodeJS Lambda function using the code available
2. Configure Environment Variables - SLACK_CHANNEL and SLACK_WEBHOOK_PATH (only the part from /services/..)
3. Create an SNS topic
3. Enable CloudWatch Event rules (shown below) for EMR clusters and choose the above created SNS topic as a Target
4. Add SNS as a Trigger for the Lambda function# cloudwatch-to-slack
##### This function is to send the EMR Events captured by CloudWatch Events service to a public Slack channel using the Incoming WebHooks feature## Setup
1. Create a NodeJS Lambda function using the code available
2. Configure Environment Variables - SLACK_CHANNEL and SLACK_WEBHOOK_PATH (only the part from /services/..)
3. Enable CloudWatch Event rules for EMR clusters and choose the above created Lambda function as a Target.#### CloudWatch Sample Rules
##### EMR-Cluster-Change event -
```
{
"source": [
"aws.emr"
],
"detail-type": [
"EMR Cluster State Change"
],
"detail": {
"state": [
"RUNNING",
"TERMINATED",
"TERMINATED_WITH_ERRORS"
]
}
}
```##### EMR-State-Change event -
```
{
"source": [
"aws.emr"
],
"detail-type": [
"EMR Step Status Change"
],
"detail": {
"state": [
"RUNNING",
"COMPLETED",
"CANCELLED",
"FAILED"
]
}
}
```###### References
1. http://matthewcooper.net/2015/08/21/aws-cloudwatch-to-slack-via-api-gateway-and-lambda/
2. https://medium.com/cohealo-engineering/how-set-up-a-slack-channel-to-be-an-aws-sns-subscriber-63b4d57ad3ea