Courseiva
Development with AWS ServiceseasyMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is building a serverless application using AWS Lambda. The application needs to process messages from an Amazon SQS queue and store results in an Amazon DynamoDB table. Which AWS service should the developer use to trigger the Lambda function when new messages arrive in the SQS queue?

⚠ Common exam trap

It's easy for candidates to confuse the direction of SNS-SQS integration, thinking SNS can subscribe to SQS to trigger Lambda, when in fact SNS publishes to SQS and Lambda must be triggered via an event source mapping or SNS topic subscription directly.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure an SQS event source mapping on the Lambda function.

AWS Lambda supports native SQS event source mappings, which allow Lambda to poll an SQS queue and invoke the function automatically when new messages arrive. This integration handles the polling, batch retrieval, and deletion of messages from the queue, making it the simplest and most efficient way to process SQS messages with Lambda.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Set up an Amazon EventBridge rule to capture SQS events and invoke Lambda.

    Why it's wrong here

    Amazon EventBridge is designed to route events from various AWS services, your own applications, and SaaS applications to targets like Lambda. However, EventBridge does not natively capture SQS message events (e.g., a message being sent to or received from a queue) as a direct event source for its rules. While you could use a separate mechanism (like another Lambda) to process SQS messages and then publish custom events to EventBridge, EventBridge itself does not directly poll or listen to SQS queues.

  • Use Amazon SNS to subscribe to the SQS queue and trigger Lambda.

    Why it's wrong here

    Amazon SNS operates on a publish/subscribe model where publishers send messages to an SNS topic, and subscribers receive those messages. While an SQS queue can be a subscriber to an SNS topic, SNS itself cannot subscribe to an SQS queue. Therefore, SNS cannot read messages from an SQS queue and subsequently trigger a Lambda function based on those SQS messages. The direction of the subscription is inverted for this proposed solution.

  • Use AWS Step Functions to poll the SQS queue and invoke Lambda.

    Why it's wrong here

    AWS Step Functions is a workflow orchestration service that allows you to define state machines to coordinate multiple AWS services. While Step Functions can interact with SQS (e.g., sending messages or waiting for tasks), it does not offer a built-in, continuous polling mechanism for an SQS queue to automatically trigger a Lambda function upon message arrival. Implementing such continuous polling within a Step Functions workflow would be overly complex and less efficient than Lambda's native SQS integration.

  • Configure an SQS event source mapping on the Lambda function.

    Why this is correct

    Configuring an SQS event source mapping on a Lambda function is the correct and most efficient approach. This mechanism enables Lambda to automatically poll the specified SQS queue, retrieve batches of messages, and then synchronously invoke the Lambda function with these messages as the event payload. Lambda manages the polling infrastructure, scaling, and ensures messages are processed, deleted upon successful execution, or returned to the queue if the function fails.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This DVA-C02 question is part of Courseiva's 724-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.