Courseiva

DVA-C02 Troubleshooting and Optimization Practice Question

A developer is deploying a new version of a Lambda function and wants to roll back immediately if errors are detected. Which deployment strategy should the developer use?

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

✓

Use AWS CodeDeploy with a canary deployment configuration

The correct option is A: AWS CodeDeploy with a canary deployment configuration. CodeDeploy supports Lambda deployments with traffic-shifting configurations, and a canary deployment shifts a small percentage of traffic first (e.g., 10% for 5 minutes) so that CloudWatch alarms can trigger an automatic rollback if errors are detected, satisfying the requirement to roll back immediately. Option B is wrong because EC2 rolling updates apply to EC2 instances, not Lambda functions. Option C is less suitable because a linear configuration shifts traffic in equal increments over time, which delays error detection compared to a canary's initial small traffic slice. Option D is wrong because immutable updates are an EC2/Elastic Beanstalk strategy, not a Lambda deployment strategy.

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 with a canary deployment configuration

    Why this is correct

    Using AWS CodeDeploy with a canary deployment configuration is the optimal strategy for safely deploying new Lambda function versions. This approach shifts a small, configurable percentage of traffic (e.g., 10%) to the new version for a specified 'bake time,' allowing real-world monitoring via CloudWatch alarms. If errors or performance issues are detected during this period, CodeDeploy automatically rolls back to the previous stable version, minimizing impact and ensuring application stability.

  • ✗

    Use an EC2 rolling update strategy

    Why it's wrong here

    An EC2 rolling update strategy is specifically designed for updating applications running on Amazon EC2 instances within an Auto Scaling Group, where instances are updated in batches. This strategy is entirely incompatible with AWS Lambda functions because Lambda operates as a serverless compute service, abstracting away the underlying infrastructure. Lambda functions do not have persistent 'instances' in the same way EC2 does, rendering rolling updates an irrelevant and inapplicable deployment method for them.

  • ✗

    Use AWS CodeDeploy with a linear deployment configuration

    Why it's wrong here

    AWS CodeDeploy's linear deployment configuration for Lambda shifts traffic to the new function version in equal, fixed increments over a specified period, such as 10% every minute. While this provides a controlled rollout, it does not inherently include automatic rollback capabilities triggered by CloudWatch alarms if errors or performance degradation are detected during the shift. This requires manual intervention to revert, making it less suitable for scenarios demanding immediate, automated error mitigation.

  • ✗

    Use an immutable update strategy

    Why it's wrong here

    An immutable update strategy is fundamentally designed for environments with mutable instances, like EC2 or containers, where a new set of resources is launched and then traffic is switched. For AWS Lambda, which is serverless and does not manage persistent 'instances' in this manner, this strategy is not directly applicable. It does not align with Lambda's versioning and alias model for gradual traffic shifting or provide built-in mechanisms for automatic rollback based on function performance.

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

One of 1,135 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.