Skip to content

Instantly share code, notes, and snippets.

@ardeshir
Forked from mlabouardy/setup.sh
Created May 14, 2018 16:31
Show Gist options
  • Save ardeshir/45a4b3cce3af4a1d99e803988085aaf9 to your computer and use it in GitHub Desktop.
Save ardeshir/45a4b3cce3af4a1d99e803988085aaf9 to your computer and use it in GitHub Desktop.
Setup CloudWatch alarm with AWS CLI
aws cloudwatch put-metric-alarm --region us-east-1
--alarm-name "HighCPUUtilization"
--alarm-description "High CPU Utilization"
--actions-enabled
--alarm-actions "TOPIC_ARN"
--metric-name "CPUUtilization"
--namespace AWS/EC2 --statistic "Average"
--dimensions "Name=InstanceName,Value=demo"
--period 60
--evaluation-periods 60
--threshold 40
--comparison-operator "GreaterThanOrEqualToThreshold"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment