Courseiva
Question 77 of 724
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer must locally test a SAM-based Lambda function with an API event before deployment. Which tool command family is designed for this?

⚠ Common exam trap

Watch out — candidates often confuse the AWS SAM CLI with other AWS CLI tools or services, mistakenly thinking that general-purpose CLI commands or unrelated security tools can perform local Lambda testing with API events.

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

AWS SAM CLI local invoke/start-api

The AWS SAM CLI provides the `local invoke` and `local start-api` commands specifically for testing Lambda functions locally with simulated API Gateway events before deployment. `sam local start-api` creates a local HTTP server that mimics API Gateway, allowing developers to send requests to their Lambda functions as if they were deployed, while `sam local invoke` directly invokes the function with a specified event payload. This is the only tool family designed for local testing of SAM-based Lambda functions with API events.

Answer analysis

Option-by-option breakdown

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

  • AWS SAM CLI local invoke/start-api

    Why this is correct

    The AWS SAM CLI `local invoke` and `local start-api` commands are specifically designed for testing serverless applications locally. `sam local invoke` allows developers to execute a single Lambda function with a provided event payload, simulating a direct invocation. `sam local start-api` launches a local HTTP server that emulates Amazon API Gateway, enabling testing of Lambda functions integrated with API Gateway by making actual HTTP requests to the local endpoint, providing a comprehensive local testing environment for SAM-based applications.

  • AWS Shield Advanced CLI

    Why it's wrong here

    AWS Shield Advanced CLI commands are used to configure and manage advanced Distributed Denial of Service (DDoS) protection for AWS resources such as Elastic Load Balancers, Amazon CloudFront distributions, and Route 53 hosted zones. This service focuses on network security and resilience against large-scale attacks. It provides no functionality for executing, simulating, or debugging Lambda functions locally, making it entirely irrelevant for the task of locally testing a SAM-based Lambda function's business logic or runtime behavior.

  • AWS Organizations policy simulator

    Why it's wrong here

    The AWS Organizations policy simulator is a tool used to evaluate the effects of Service Control Policies (SCPs) within an AWS Organization on specific AWS accounts. Its purpose is to help administrators understand which actions are allowed or denied by the applied SCPs, ensuring governance and compliance across the organization. This simulator does not provide any mechanism to execute, debug, or test the functional code of a Lambda function locally, as its scope is purely policy evaluation, not application runtime testing.

  • Amazon Inspector SBOM export

    Why it's wrong here

    Amazon Inspector's SBOM (Software Bill of Materials) export functionality provides a detailed list of open-source and third-party components used within an application, along with their known vulnerabilities. This feature is crucial for identifying security risks in dependencies and maintaining software supply chain security. However, exporting an SBOM is an auditing and security analysis function; it does not involve executing the Lambda function's code or simulating its runtime environment locally, thus it cannot be used for functional local testing.

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

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.