86.1k views
5 votes
A medium-sized business has a taxi dispatch application deployed on an amazon ec2 instance. because of an unknown bug, the application causes the instance to freeze regularly. then, the instance has to be manually restarted via the aws management console. which of the following is the most cost-optimal and resource-efficient way to implement an automated solution until a permanent fix is delivered by the development team?

a. Setup a CloudWatch alarm to monitor the health status of the instance. In case of an Instance Health Check failure, an EC2 Reboot CloudWatch Alarm Action can be used to reboot the instance
b. Use CloudWatch events to trigger a Lambda function to reboot the instance status every 5 minutes
c. Use CloudWatch events to trigger a Lambda function to check the instance status every 5 minutes. In the case of Instance Health Check failure, the lambda function can use AWS EC2 API to reboot the instance
d. Setup a CloudWatch alarm to monitor the health status of the instance. In case of an Instance Health Check failure, CloudWatch Alarm can publish to an SNS event which can then trigger a lambda function. The lambda function can use AWS EC2 API to reboot the instance

User Ionelmc
by
8.7k points

1 Answer

6 votes

Final answer:

The most cost-optimal solution is to set up a CloudWatch alarm to monitor the instance, and on failure, automatically reboot the instance using EC2 Reboot CloudWatch Alarm Action.

Step-by-step explanation:

The most cost-optimal and resource-efficient automated solution to address a taxi dispatch application that regularly freezes on an Amazon EC2 instance would be Option A: setting up a CloudWatch alarm to monitor the health status of the instance. Upon detection of an Instance Health Check failure, a predefined EC2 Reboot CloudWatch Alarm Action can be configured to automatically reboot the instance. This method leverages AWS's native tools to respond to issues without incurring additional costs or resource uses associated with continuously running a Lambda function or initiating unnecessary reboots.

User David McLean
by
7.8k points