Question 1,239 of 724
DVA-C02 Deployment Practice Question
A developer is deploying a new version of a Lambda function using the AWS CLI. Which command should the developer use to update the function code?
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 lambda update-function-code
The `update-function-code` command updates the code of a Lambda function. Option B (`update-function-configuration`) updates configuration settings only, not the code. Option C (`invoke`) is for invoking the function, and option D (`create-function`) is for creating a new function, not updating an existing one.
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 lambda update-function-code
Why this is correct
aws lambda update-function-code is the correct command because it uploads a new deployment package (ZIP file or container image) to the Lambda service, replacing the code currently associated with the function. This command updates the function's code while preserving its configuration, and it operates on the $LATEST version unless you specify a different qualifying qualifier, making it the proper way to deploy a new code version.
- ✗
aws lambda update-function-configuration
Why it's wrong here
aws lambda update-function-configuration is incorrect because it modifies the function's runtime, memory limit, timeout, environment variables, VPC settings, and IAM role, but it does not alter the code logic itself. Updating the configuration alone leaves the current code in place, so it cannot introduce a new version of the application logic.
- ✗
aws lambda invoke
Why it's wrong here
aws lambda invoke is incorrect because it only synchronously or asynchronously executes the currently deployed Lambda function and returns the invocation response, execution status, and logs. It performs no write operations on the function's code or configuration, so it cannot update any aspect of the function, let alone deploy a new version.
- ✗
aws lambda create-function
Why it's wrong here
aws lambda create-function is incorrect because this command provisions an entirely new Lambda function resource, including its unique function name, execution role, and handler. Running it against an existing function name will fail or require deleting the current function first, so it cannot be used to deploy a new version of an already deployed function.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, 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 →
Last reviewed: Jun 20, 2026
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.
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.
Sign in to join the discussion.