Source: towardsthecloud.com

Trigger a Cloudwatch alarm using AWS CLI
To trigger or test an Amazon CloudWatch alarm using the AWS CLI, you have to run the command aws cloudwatch https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/set-alarm-state.html in your terminal. Note: When using an AWS CLI command to trigger and test an existing CloudWatch alarm, make sure to https://towardsthecloud.com/set-up-aws-cli-aws-sso.

How to test a CloudWatch alarm using AWS CLI

To change the state of the alarm run the following command: aws cloudwatch set-alarm-state --alarm-name "ec2-cpu-above-75-percent" --state-reason "Testing the Amazon Cloudwatch alarm" --state-value ALARM

You’ve seen how you can trigger any Amazon CloudWatch alarm on your AWS account using the set-alarm-state command using the AWS CLI.

Related Articles