The reason why your DLQ does not work is because using Test
button or invoking function using:
aws lambda invoke --function-name testFunction --payload '{"desire":"error"}' /tmp/out.json
result in synchronous invocations, rather then asynchronous ones.
To invoke your function asynchronously, you have to use Event
type in the CLI:
aws lambda invoke --function-name testFunction --invocation-type Event --payload '{"desire":"error"}' /tmp/out.json
CLICK HERE to find out more related problems solutions.