準備
対象のEC2 分離IDを取得連携対象
のSNSの
arn を取得コンソール画面上から見てもOK
オプションいっぱいのコマンド
1 2 3 4 5 6 7 8 9 10 |
aws cloudwatch put-metric-alarm --alarm-name "CPUUtilization80%" --namespace AWS / EC2 \ --metric-name CPUUtilization --dimensions "Name = InstanceId、Value = i-0219028c30d71bee2"-期間300 \ --statistic Average --threshold 80 --comparison-operator GreaterThanOrEqualToThreshold¥ --evaluation-periods 1 --alarm-actions arn:aws:sns:ap-northeast-1: 697333814928:Default_CloudWatch_Alarms_Topic \ --ok-actions arn:aws:sns:ap-northeast-1:697333814928:Default_ CloudWatch_Alarms_Topic |