QuestionQ17

Monitoring, Logging, Analysis, Remediation, and Performance Optimization

A company hosts a web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The company requires an AWS Lambda function to carry out a custom recovery procedure on the application server whenever the application returns an HTTP 500 status code.

A CloudOps engineer must design a solution that detects HTTP 500 status codes and reliably runs the Lambda function when errors occur.

Which solution meets these requirements?

Explanation

The HTTPCode_Target_5XX_Count metric in the AWS/ApplicationELB namespace records HTTP 5xx response codes generated by ALB targets. A CloudWatch alarm can monitor this metric and invoke a Lambda function as its alarm action. CloudWatch alarms invoke Lambda asynchronously on the relevant alarm state change and retry if they cannot reach Lambda or the invocation is rejected, providing the required reliable trigger.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!