DVA-C02 Deployment Practice Question
A developer is deploying a new version of an AWS Lambda function using the AWS CLI. The developer wants to create a new version and update the alias to point to the new version. Which sequence of CLI commands should the developer use?
⚠ Common exam trap
Test-takers frequently think they can update the alias before publishing the version, or they confuse the order of operations by assuming the alias can point to $LATEST, but the exam requires the alias to reference a specific published version for immutability and rollback safety.
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
✓
Update function code, publish version, update alias
The correct sequence is to first update the function code, then publish a new version, and finally update the alias to point to that new version. The `update-function-code` command uploads the new code to the $LATEST version, `publish-version` creates an immutable numbered version from $LATEST, and `update-alias` updates the alias to reference that specific version. This ensures the alias always points to a stable, published version rather than the mutable $LATEST.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Update alias, update function code, publish version
Why it's wrong here
Updating an alias before the new function code is even deployed and published as a distinct version is premature and ineffective. An alias must point to an existing, immutable version of the Lambda function. Attempting to update it at this stage would either point to the old code or fail because the desired new version does not yet exist, preventing proper traffic redirection.
- ✗
Create alias, update function code, publish version
Why it's wrong here
Creating an alias requires specifying a target Lambda function version ARN. If the developer attempts to create an alias before the new function code has been deployed and subsequently published as a new, immutable version, there is no specific version for the alias to reference. This sequence would prevent the alias from being correctly configured to point to the desired new deployment.
- ✗
Publish version, update function code, update alias
Why it's wrong here
Publishing a version of a Lambda function creates an immutable snapshot of the function's *current* code and configuration. If this step occurs *before* the new function code has been updated, the published version will inadvertently contain the old code. This would result in deploying the previous functionality under a new version number, necessitating another code update and version publication to achieve the desired outcome.
- ✓
Update function code, publish version, update alias
Why this is correct
First, updating the function code ensures the `$LATEST` version contains the desired new logic. Next, publishing a version creates an immutable snapshot of this updated code, providing a stable reference point. Finally, updating the alias to point to this newly published version allows for controlled traffic shifting, enabling safe deployments, rollbacks, and advanced strategies like canary releases.
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 |
Go deeper
Related to this question
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 →
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.