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.
To create a rule that triggers on an event:Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ . In the navigation pane, choose Events, Create rule. For Event source, do the following: Choose Event Pattern, Build event pattern to match events by service.
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances. Select the instance and choose Actions, Monitor and troubleshoot, Manage CloudWatch alarms. On the Manage CloudWatch alarms detail page, under Add or edit alarm, select Create an alarm.
To test your ruleOpen the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ . In the navigation pane, choose Events, Rules, select the name of the rule that you created, and choose Show metrics for the rule.
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...
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With