背景

CloudWatchAlarmのテストです。

やったこと

まずは、AWS CLIでCloudWatchAlarmsの一覧を出力します。

aws --profile ars cloudwatch describe-alarms | jq -r '.MetricAlarms[] | [.AlarmName] | @csv'

次に、以下のようなコマンドを作って1つずつ投入します。

aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-EC2Healthy" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-RDS-cpu_utilization_too_high" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-RDS-disk_queue_depth_too_high" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-RDS-free_storage_space_too_low" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-RDS-freeable_memory_too_low" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-RDS-healthy" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-alb-healthyhosts-mars_g_a" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-alb-healthyhosts-mars_g_c" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-alb-high5XXCount" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-alb-tg-mars_g_a-high5XXCount" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "prod-alb-tg-mars_g_c-high5XXCount" --state-value ALARM --state-reason "test"

もういっちょ。

aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-EC2Healthy" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-RDS-cpu_utilization_too_high" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-RDS-disk_queue_depth_too_high" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-RDS-free_storage_space_too_low" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-RDS-freeable_memory_too_low" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-RDS-healthy" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-alb-healthyhosts-mars_g_a" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-alb-healthyhosts-mars_g_c" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-alb-high5XXCount" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-alb-tg-mars_g_a-high5XXCount" --state-value ALARM --state-reason "test"
aws --profile ars cloudwatch set-alarm-state --alarm-name "stag-alb-tg-mars_g_c-high5XXCount" --state-value ALARM --state-reason "test"

気になったこと

通知されるメッセージのタイムゾーンがUTCなのが、気になります。

JSTにならないかな。。。