DVA-C02 - Development with AWS Services - Section 1.6

Integrate AWS Lambda with event sources and handle the event lifecycle using event source mapping, Lambda destinations, dead-letter queues and VPC access.

Integrate AWS Lambda with event sources via event source mapping and understand how batch size, bisect-on-error, and maximum retry settings control the event lifecycle. Use Lambda destinations and dead-letter queues to handle function success and failure outcomes, and configure VPC access when the function must reach private resources.

Event source mappingLambda destinationsLambda in a VPCDead-letter queues

Practice question for this objective

Free sampleDevelopment with AWS Servicesmedium

A developer connects a Lambda function to an Amazon SQS standard queue using an event source mapping. The function occasionally fails when a downstream API is briefly unavailable, and those failed batches are retried so often that good messages are delayed. The developer wants messages that repeatedly fail to be set aside automatically for later inspection without losing them. What should the developer configure?

  • AEnable Lambda provisioned concurrency on the function so failing batches are processed faster and stop blocking the rest of the queue.
  • BLower the function timeout so failing invocations end quickly and SQS can return the messages to the queue for a faster overall retry cycle.
  • CConfigure a redrive policy on the source queue with a dead-letter queue and a maxReceiveCount so repeatedly failed messages move there. Correct
  • DSet a Lambda on-failure destination pointing at the dead-letter queue, because event source mapping batch failures are delivered through destinations.
Use an SQS dead-letter queue with a redrive policy and maxReceiveCount to isolate poison messages from a Lambda event source mapping. For a poll-based SQS event source mapping the queue itself owns failure handling, so a redrive policy moves a message to the dead-letter queue after it has been received more than maxReceiveCount times, which removes repeatedly failing messages from the main flow while preserving them.

Why A is wrong: Provisioned concurrency reduces cold-start latency but does nothing about poison messages, so the same batches keep failing and there is still no place to set them aside.

Why B is wrong: A shorter timeout only makes each failed attempt end sooner, so the poison messages keep returning to the queue and are never moved aside for inspection.

Why C is correct: The SQS redrive policy moves a message to the dead-letter queue once its receive count exceeds maxReceiveCount, isolating poison messages so good ones flow while the failures are kept for inspection.

Why D is wrong: On-failure destinations apply to asynchronous invocations, not to SQS event source mapping batches, so for an SQS source the queue's own redrive policy is the correct mechanism.

See more DVA-C02 practice questions, answers explained.

More in this domain

Back to all Development with AWS Services objectives, or the DVA-C02 cert hub.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.