はじめに IoT Coreで受け取った測定データが特定のしきい値を超えた場合に通知を受け取りたいことってありますよね?? また、実際に機器を扱う現場ではアラートが出た後、しきい値を下回った場合にも通知を受け取りたいということも多いと思います。 今回は受け取ったデータを可視化サービスで通知設定したり、lambdaで加工したり、DBに保存してなんやかんやしなくても、IoT CoreとCloudWatchを使って上記の仕組みを簡単に作る方法をご紹介します。 やりたいことをイラストにするとこんな感じです。 しきい値を超えた場合に通知を受け、正常に戻った場合も通知を受けとります。 条件 今回は以下の条件で通知を行いたいと思います。 値が30.0を超えたらアラート通知 ステータスがアラート状態から正常に回復した場合に回復通知 しきい値は整数しか設定できません。 そのため小数点以下の精度で判断が必要な場