Skill 1.2.3
Handle the event lifecycle and errors by using code (for example, Lambda Destinations, dead-letter queues)
Key Concepts
For synchronous invocations the error is returned to the caller, which decides whether to retry. For asynchronous invocations Lambda retries twice, and you can tune the maximum retry attempts (0 to 2) and maximum event age (up to 6 hours). Failed events can go to an on-failure destination or a dead-letter queue; destinations are preferred because they include the error details and can also capture successful results.
For event source mappings, a thrown error makes Lambda retry the whole batch. With SQS, returning batchItemFailures (with ReportBatchItemFailures enabled) retries only the failed messages, and the queue's own redrive policy moves repeatedly failing messages to a DLQ. With Kinesis and DynamoDB Streams you can bisect failing batches, limit retries and set an on-failure destination so one bad record does not block the shard.