Trigger AWS CloudWatch Event Manually

Adam picture Adam · Sep 20, 2019 · Viewed 12k times · Source

I have a event in CloudWatch, which is triggered once a day. Is there a way to trigger the event manually (for testing purposes)?

...I realize I can increase the frequency of the event's triggering schedule.

Answer

danimal picture danimal · Sep 20, 2019

If you have a cloudwatch alarm set up, using the AWS CLI you can, for testing purposes, set the alarm state of that alarm:

aws cloudwatch set-alarm-state --alarm-name "myalarm" --state-value ALARM --state-reason "testing purposes"

see the docs here

Alternatively you can put a custom event, also using the CLI or the SDKs