Courseiva
Development with AWS ServiceshardMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

Network Topology
function-name my-functionaws lambda invokepayload '{"key1": "value1"}' response.json

Refer to the exhibit. A developer runs the AWS CLI command to invoke a Lambda function. The command succeeds, but the function returns an error. The developer wants to see the error message and logs from the function execution. What should the developer add to the command?

⚠ Common exam trap

Many candidates confuse `--invocation-type Event` (async) with the ability to retrieve logs, not realizing that only synchronous invocations (`RequestResponse`) return execution results and logs via `--log-type Tail`.

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

--log-type Tail

The `--log-type Tail` parameter instructs the AWS CLI to retrieve the last 4 KB of log data from the function's execution and base64-encode it in the response. This allows the developer to see the error message and logs directly without needing to query CloudWatch Logs separately. The command must also use `--invocation-type RequestResponse` (the default) to get a synchronous response containing the logs.

Answer analysis

Option-by-option breakdown

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

  • --client-context string

    Why it's wrong here

    The --client-context parameter is used to pass a base64-encoded JSON string containing custom client-specific data to the Lambda function. This data is accessible within the function's invocation context and is typically used for client libraries, tracing, or custom metrics. It serves as an input mechanism for the function and has no capability to retrieve or influence the logging output generated by the function itself.

  • --qualifier alias

    Why it's wrong here

    The --qualifier parameter specifies a particular version or alias of the Lambda function to invoke, rather than the $LATEST version. This allows developers to target specific deployments for testing or production traffic routing. While crucial for managing function deployments and ensuring the correct code executes, this parameter solely dictates which function code is run and does not provide any mechanism to retrieve logs from the invocation response.

  • --invocation-type Event

    Why it's wrong here

    Setting --invocation-type to Event instructs Lambda to invoke the function asynchronously, meaning the caller does not wait for the function to complete execution. In this 'fire-and-forget' model, the Lambda service queues the event and returns an immediate response without any function output or logs. Consequently, this invocation type is inherently incompatible with retrieving execution logs directly in the CLI response, as the logs are instead sent to CloudWatch asynchronously.

  • --log-type Tail

    Why this is correct

    The --log-type Tail parameter is specifically designed to retrieve the last 4 KB of log data generated by a synchronous Lambda function invocation. When used with RequestResponse invocation type, this option includes the base64-encoded log output in the LogResult field of the CLI response. This provides immediate access to recent execution logs directly within the terminal, which is invaluable for debugging and quick verification of function behavior.

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 writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.