Trigger AWS CloudWatch Event Manually

Another solution I found is to disable then re-enable the rule:

aws events disable-rule --name "my_scheduled_rule"
aws events enable-rule --name "my_scheduled_rule"

Perhaps not the best route but an option...


I haven't found (and I don't think it is possible) a way to trigger a scheduled trigger manually. But as danimal mentions you can put a custom event to trigger it.

# update your rule to trigger on a dummy-event source
# put-rule updates a rule if it exists or creates a new one if it doesn't
aws events put-rule --name "my-rule" --event-pattern "{\"source\":[\"karlanka\"]}"
    
# send an event with the same dummy source to trigger the rule
# Detail and DetailType are required but not used
aws events put-events --entries '[{"Source":"karlanka","DetailType":"X","Detail":"{}"}]'
    
# then change the rule back to your schedule
aws events put-rule --name "my-rule" --schedule-expression "rate(12 hours)"


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