'Always keep EC2 Instance running even if it was stopped based on its TAG

I have some EC2 instances with specific TAGs that are monitored by event bridge and if some action occur the instance must be stopped and then started again. This was already done. But sometimes the instance didn't start again (looks like the event bridge don't get the event of stopped instance to automatically start it).

Which is the best way to schedule a script or something else to every minute check all the stopped instances with specific TAG and then start it?

Thanks in Advance!



Solution 1:[1]

In this case I used a Python Lambda function to perform the EC2 start. And the lambda is scheduled by eventbridge (cloud Watch Events)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Winner Martins