Courseiva
Deployment →easyMultiple Choice

DVA-C02 Deployment Practice Question

A developer deploys a new version of an AWS Lambda function using the AWS CLI. After the deployment, the function starts returning errors. The developer needs to quickly revert to the previous version without redeploying. What should the developer do?

⚠ Common exam trap

Candidates often confuse versions and aliases. Remember that Lambda versions are immutable (cannot be changed once published), while aliases are mutable (can be updated to point to different versions). This mutability is what allows for instant rollbacks.

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 the alias to point to the previous version.

AWS Lambda versions are immutable, while aliases are mutable pointers to specific function versions. By updating the alias to point to the previous version, the developer can instantly revert traffic to the stable code without any redeployment, as the alias is used as the invocation target (e.g., via the function's ARN with the alias name). This approach leverages Lambda's built-in versioning and alias routing, which is the fastest and safest rollback mechanism.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Use AWS CodeDeploy to automatically roll back the deployment.

    Why it's wrong here

    Using AWS CodeDeploy for an automatic rollback is typically part of a pre-configured CI/CD pipeline that manages the deployment strategy itself (e.g., canary, linear deployments). While CodeDeploy can orchestrate rollbacks, for a simple manual rollback of a newly deployed Lambda version, directly manipulating Lambda's built-in versioning and aliasing is a more immediate and efficient approach. CodeDeploy is an orchestrator, not the direct mechanism for reverting a Lambda version in this specific context.

  • ✓

    Update the alias to point to the previous version.

    Why this is correct

    Updating the alias to point to the previous version is the most effective and fastest method for an instant rollback. AWS Lambda aliases are mutable pointers to specific, immutable function versions. By simply redirecting the alias from the problematic new version to a known stable version, all subsequent invocations through that alias immediately begin using the stable code, ensuring zero downtime and minimal operational overhead.

  • ✗

    Use the AWS CLI to update the function code with the previous code.

    Why it's wrong here

    Using the AWS CLI to update the function code with the previous code would involve uploading the old deployment package, which creates a *new* function version. This process is slower than simply redirecting an existing alias, as it requires the Lambda service to process and publish a new version. It also consumes an additional version slot and doesn't leverage the immutability of existing, already published versions for a quick switch.

  • ✗

    Delete the current function and recreate it using the previous deployment package.

    Why it's wrong here

    Deleting the current function and recreating it using the previous deployment package is an extremely disruptive and error-prone method. This action would result in significant downtime, as the function would be unavailable during deletion and recreation. Furthermore, all associated configurations, such as triggers, environment variables, and permissions, would need to be manually re-established, making it a time-consuming and high-risk operation that disregards Lambda's robust versioning capabilities.

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

This DVA-C02 question is part of Courseiva's 1,135-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 →

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.