What should the developer do to accomplish this goal with the LEAST operational overhead?
Set up Amazon CloudWatch Logs log groups to filter and store the messages in an Amazon S3 bucket. Import the messages in Lambda. Run the Lambda function again.
Configure Amazon EventBridge to send the messages to Amazon Simple Notification Service (Amazon SNS) to initiate the Lambda function again.
Implement a dead-letter queue for discarded messages. Set the dead-letter queue as an event source for the Lambda function.
Send Amazon EventBridge events to an Amazon Simple Queue Service (Amazon SQS) queue. Configure the Lambda function to pull messages from the SQS queue. Run the Lambda function again.
Explanations:
While storing messages in CloudWatch Logs and then importing them for retries could work, it introduces significant operational overhead. It requires manual log filtering and importing, making it less efficient and more prone to errors in managing retries.
Using Amazon EventBridge to send messages to Amazon SNS does not directly address the requirement for storing failed invocation messages for later retries. It could complicate the architecture and does not provide a straightforward way to manage retries, leading to increased operational overhead.
Implementing a dead-letter queue (DLQ) allows failed invocation messages to be automatically sent to a specified SQS queue. This solution minimizes operational overhead as it enables automatic handling of failures, allowing for easy retries by reprocessing messages from the DLQ without manual intervention.
Although using EventBridge with SQS allows for message storage, it complicates the retry mechanism. The Lambda function needs to be explicitly configured to pull from the SQS queue for retries, which adds complexity and overhead compared to a DLQ setup that automates the retry process.