LoginSignup
0

More than 1 year has passed since last update.

posted at

updated at

CloudWatchAlarmの発砲テスト方法

これは何?

CloudWatchAlarmからSNSへ連携されてLambdaがトリガーされる仕組みを作っていたのですが、
アラート発生のテストで毎回CPU使用率を上げるなど面倒だったが簡単な方法を見つけたのでメモです。

CloudWatchAlarmテストコマンド

<Alarm Name>をテストしたいCloudWatchAlarm名に変更して実行します。

aws cloudwatch set-alarm-state --alarm-name <Alarm Name> --state-value ALARM --state-reason "test"

CloudWatchAlarmのアラーム状態解除コマンド

aws cloudwatch set-alarm-state --alarm-name <Alarm Name> --state-value OK --state-reason "test"

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0