A sample AWS Lambda function to push Amazon CloudWatch alarms to IFTTT via the Maker channel.
Copyright (c) 2015 Danilo Poccia, http://danilop.net
This code is licensed under the The MIT License (MIT). Please see the LICENSE file that accompanies this project for the terms of use.
- Go to https://ifttt.com/maker and write down your secret key
- 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
- 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 {{Value1}}
- 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
Please give me your feedback here.