Use a Lambda Function to Reboot EC2 Instance when Unresponsive
Scenario: I have an EC2 Instance, t2.micro, that hosts a WordPress site. Every so often, the website becomes non-responsive and the EC2 instance needs to be rebooted. In this blog post, we’ll create a Lambda function that makes an HTTP Request to the website. If the HTTP Request fails three consecutive times in a row, we’ll reboot the instance. An email or notification will be sent to the responsible party to verify the instance is back up and operational.