- Newest
- Most votes
- Most comments
Based on the information provided, there are a few potential reasons why your stop rule might not be working as expected while the start rule is functioning correctly. Here are some suggestions to help identify and resolve the issue:
-
Check EventBridge rule execution: Verify that the stop rule is actually being triggered at the scheduled time. You can do this by checking the CloudWatch Logs for the rule execution or by adding a CloudWatch Logs action to your rule for debugging purposes.
-
Verify instance state: Ensure that the instance is in a 'running' state when the stop rule is scheduled to execute. Resource Scheduler (and by extension, EventBridge rules) only stops instances if they are in the 'running' state. If the instance is already stopped or in any other state, the stop action won't take effect.
-
Review IAM permissions: Although you mentioned that IAM permissions seem adequate, double-check that the IAM role associated with the EventBridge rule has the necessary permissions to stop EC2 instances. The required permission is 'ec2:StopInstances'.
-
Check for conflicting schedules: Ensure that there are no other automation tools or schedules that might be interfering with the stop action. For example, if you have multiple schedules or automation scripts running, they might be conflicting with each other.
-
Verify the correct instance ID: Double-check that the instance ID specified in the stop rule is correct and matches the instance you're trying to stop.
-
Monitor CloudTrail logs: Review AWS CloudTrail logs to see if there are any failed API calls or permission issues related to the StopInstances API action.
-
Test manual stop: Try stopping the instance manually at the scheduled stop time to ensure there are no issues with the instance itself that might prevent it from stopping.
-
Consider using Systems Manager Resource Scheduler: As an alternative to custom EventBridge rules, you could use AWS Systems Manager Resource Scheduler, which is designed specifically for scheduling start and stop actions for EC2 instances. This service handles the complexities of instance state management and scheduling.
If none of these steps resolve the issue, you may want to consider creating a new stop rule from scratch to eliminate any potential configuration errors in the existing rule. Additionally, reaching out to AWS Support might be helpful if the problem persists after trying these troubleshooting steps.
Sources
Stop and start EC2 instances automatically on a schedule using Quick Setup - AWS Systems Manager
Stop and start Amazon EC2 instances - Amazon Elastic Compute Cloud
In your word doc you are using 1am and not 1pm for the UTC Time. It is powering off at 1 am and then your powering it back on at 3am.
Update your CRON schedule for stop to be 13 and not 1
You may find they are powering off at 7am and powering back on at 9am because of this instead of 7pm
Thx yesterday I also came to same conclusion, when I used eventbridge with lambda to stop the server. my lambda also not invoked.
I’m glad you’re able to resolve your issue. All the best. Gary
Please share rule screenshots along with the eventbridge targets. I do this a lot and have no issues. Id also check cloudtrail logs to make sure the Role issuing the STOP has the correct IAM access
Please check the documentation titled "My Setup Document", where I have included screenshots of the target configuration and role permissions.
Additionally, I am using EventBridge Scheduler, so I haven’t created any EventBridge rules. (Using API CALL) EventBridge Scheduler->cron setup->All API->ec2->StopInstances.
Appologies I missed that
Read word doc.. Created new answer.. I May have spotted an issue
Hi,
You want to check this doc to see how to troubleshoot EC2 instances not stopping: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html
This KC question may also prove useful in your case: https://repost.aws/knowledge-center/ec2-instance-stuck-stopping-state
Best,
Didier
not helpful, These all are method if you server is stuck. but my server is running I want to stop it at specific time using eventbridge scheduler only.
Relevant content
- asked 6 months ago

I created 2 eventbridge scheduler for start & stop purpose both have same rule. 1 is working other is not. please check the word file as well .