A company is designing a new serverless data processing pipeline. The pipeline uses AWS Lambda to process records from an Amazon Kinesis Data Stream. The company wants to ensure that failed records are automatically retried and sent to a dead-letter queue after three failed attempts. Which configuration should the company use?
The event source mapping for Kinesis supports an on-failure destination for DLQ.
Why this answer
The on-failure destination on a Kinesis event source mapping allows you to specify an SQS queue to which records are sent after a configurable number of retry attempts (default is 3). This is the native mechanism for handling failed records in a Lambda-Kinesis integration, providing automatic retries and dead-letter queue behavior without custom code.
Exam trap
The trap here is that candidates often confuse the Lambda function's dead-letter queue (DLQ) property, which only works for asynchronous invocations, with the on-failure destination on event source mappings, which is the correct configuration for stream-based sources like Kinesis.
How to eliminate wrong answers
Option A is wrong because a Kinesis stream cannot directly send records to an SQS queue; the dead-letter handling must be configured on the event source mapping, not on the stream itself. Option C is wrong because the Lambda function's dead-letter queue property (DLQ) is only applicable for asynchronous invocations, not for stream-based event source mappings like Kinesis. Option D is wrong because Lambda destinations are used for routing invocation results (success/failure) to other services, but they do not provide the automatic retry and dead-letter queue behavior for failed records from a Kinesis stream; the on-failure destination on the event source mapping is the correct mechanism.