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?
⚠ Common exam trap
DVA-C02 often tests the distinction between updating function code versus configuration, so candidates might confuse the two commands.
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 AWS CLI command `aws lambda update-function-code` is specifically designed to update the code of an existing Lambda function. It allows you to specify the function name and the location of the new code (e.g., S3 bucket and key, or a local zip file). This is the correct command for deploying a new version of the function code.
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
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 1,135 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 →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
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.