Course menuDVA-C02

Exams / DVA-C02 / Lambda invocation, errors and destinations / Question 2

DVA-C02 practice question: Lambda invocation, errors and destinations (2 of 2)

Development with AWS Services A free question from our original DVA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

A developer is deciding where Lambda needs an event source mapping, which is a Lambda resource that reads items from a source and invokes the function with batches. Which TWO event sources are processed this way? (Choose two.)

Choose two answers.

  1. A. Amazon S3 event notifications
  2. B. Amazon SQS queues
  3. C. Amazon SNS topics
  4. D. Amazon DynamoDB Streams
  5. E. Amazon API Gateway
Show the answer and explanation

Answers: B, D

  • A. Wrong: S3 pushes events to Lambda. The trigger is configured on the bucket, not as an event source mapping.
  • B. Right: Correct. Lambda polls the queue and invokes the function with batches of messages.
  • C. Wrong: SNS pushes messages to the function as a subscription. Lambda does not poll it.
  • D. Right: Correct. Lambda reads stream records through an event source mapping, in order per shard.
  • E. Wrong: API Gateway invokes the function directly for each request. There is nothing to poll.

Explanation

Lambda uses event source mappings for poll-based sources such as SQS, Kinesis, DynamoDB Streams, Amazon MQ and Kafka. Services such as S3, SNS and API Gateway push events to the function themselves, and the trigger is stored by that service. Knowing which model applies tells you where batching, retries and failure handling are configured.

Study

Keep practising

Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.