CloudWatchAlarm2IFTTT, a sample AWS Lambda function to push Amazon CloudWatch alarms to IFTTT via the Maker channel
CloudWatchAlarm2IFTTT is a sample AWS Lambda function to push Amazon CloudWatch alarms to IFTTT via the Maker channel.
You can choose what Action you want to do on IFTTT, for example: 1. iOS or Android Notifications to receive it on your mobile (you need the IF app from IFTTT installed on the device) 2. A Channel from the Connected Home category to have a visible effect, e.g. Philips Hue to change the color of your lights to red 3. Slack to send a message to your team 4. Trello to create a new card 5. GitHub to create a new issue
You can find CloudWatchAlarm2IFTTT in its GitHub repository.
Installation
On IFTTT
- Go to https://ifttt.com/maker and write down your secret key
On AWS
- Create a new Amazon SNS topic, e.g.
cloudwatch-alarms
- Create a new AWS Lambda function, e.g.
cloudwatch-2-ifttt
- Use Node.js as runtime
- Paste the code inline from the
index.js
file included in this repository - Replace the
iftttMakerSecretKey
with the one you wrote down at step 1 - (Optional) Replace the
iftttMakerEventName
with the one you want to use - Leave the default handler
- Use a basic execution role
- Leave the default memory (128MB) and timeout (3s)
- Add SNS as an event source to the Lambda function
- Choose the SNS topic created at step 2
- In the options, enable the event source now (not later)
- For the CloudWatch Alarms you want to push to IFTTT
- Select the state you are interested to. e.g.
State is ALARM
- Send notification to the SNS topic created at step 2
On IFTTT
- Select My Recipes
- Create a Recipes
- Choose Maker as Trigger (‘this’)
- Select Receive a Web Request
- Write the Event Name exacly as is the
iftttMakerEventName
variable of the Lambda function (step 3.4) - Select Create Trigger
Value1
contains a summary of the CloudWatch alarm as built in the Lambda function- Choose whatever you want as Action (‘that’), for example:
- iOS or Android Notifications to receive it on your mobile (you need the IF app from IFTTT installed on the device), e.g. you can set the notification to
CloudWatch
- A Channel from the Connected Home category to have a visible effect, e.g. Philips Hue to change the color of your lights to red
- Slack to send a message to your team
- Trello to create a new card
- GitHub to create a new issue
Contribute
Please give me your feedback and fork the repository on GitHub.