Which solution meets these requirements with the LEAST operational overhead?
Write a script that monitors the CPU utilization of the EC2 instances and reboots the instances when utilization exceeds 80%. Run the script as a cron job.
Add an Amazon CloudWatch alarm for CPU utilization and configure the alarm action to reboot the EC2 instances.
Create an Amazon EventBridge rule using the predefined patterns for CPU utilization of the EC2 instances. When utilization exceeds 80%, invoke an AWS Lambda function to restart the instances.
Add an Amazon CloudWatch alarm for CPU utilization and configure an AWS Systems Manager Automation runbook to reboot the EC2 instances when utilization exceeds 80%.
Explanations:
Writing and managing a custom script adds operational overhead, as it requires monitoring, maintaining, and executing the script. Cron jobs also require manual management and may not scale efficiently.
A CloudWatch alarm with an automatic action to reboot EC2 instances when CPU utilization exceeds 80% is a simple and effective solution with minimal operational overhead. CloudWatch alarms are built to handle such tasks with automatic triggers.
While an EventBridge rule can be set up to monitor CPU utilization, it requires an additional AWS Lambda function to manage the restart process. This introduces unnecessary complexity compared to using a direct CloudWatch alarm with a built-in action.
Although using CloudWatch alarms with AWS Systems Manager Automation is a valid approach, it introduces additional complexity. Systems Manager Automation runbooks require more setup and management than simply using the built-in alarm actions for EC2 instances.