What is the MOST operationally efficient solution that meets these requirements?
Configure Amazon CloudWatch Logs to save the error messages to a separate log stream.
Create a new SQS queue. Set the new queue as a dead-letter queue for the application queue. Configure the Maximum Receives setting.
Change the SQS queue to a FIFO queue. Configure the message retention period to 0 seconds.
Configure an Amazon CloudWatch alarm for Lambda function errors. Publish messages to an Amazon Simple Notification Service (Amazon SNS) topic to notify administrator users.
Explanations:
While configuring Amazon CloudWatch Logs can help in monitoring and debugging, it does not provide a mechanism for deferring or storing error messages for further analysis. This option does not prevent the SQS queue from becoming blocked.
Creating a new SQS queue as a dead-letter queue (DLQ) allows the application to redirect messages that cannot be processed after a defined number of attempts (Maximum Receives). This prevents the main queue from becoming blocked and enables further analysis of the failed messages.
Changing the SQS queue to a FIFO queue with a message retention period of 0 seconds would lead to immediate deletion of messages. This option does not defer messages with errors or allow for further analysis; it would effectively eliminate the ability to troubleshoot issues with the messages.
Configuring a CloudWatch alarm for Lambda errors and publishing notifications to an SNS topic helps in alerting administrators about failures, but it does not address the need to defer and store the erroneous messages for further analysis. This does not prevent the queue from becoming blocked either.