Courseiva
Question 605 of 724
DeploymentmediumMultiple ChoiceObjective-mapped

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

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: Jul 4, 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.