Courseiva

DVA-C02 Development with AWS Services Practice Question

A developer is deploying a new version of an AWS Lambda function using the AWS CLI. The function is currently active and handling traffic. The developer wants to gradually shift traffic to the new version and rollback if errors increase. Which TWO actions should the developer take? (Choose TWO.)

⚠ Common exam trap

Candidates often think they must use an external service like CodeDeploy (Option E) for gradual traffic shifting, but Lambda aliases natively support weighted routing without additional services.

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

✓

Configure the alias to route a percentage of traffic to the new version and the rest to the current version.

Lambda aliases support weighted routing, allowing you to specify a percentage of traffic to send to a new version while the remainder goes to the current version. This enables canary deployments where you can monitor error rates and rollback by adjusting the weights without redeploying.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Configure the alias to route a percentage of traffic to the new version and the rest to the current version.

    Why this is correct

    This is a core capability of Lambda aliases, allowing for controlled, gradual rollouts of new function versions. By configuring a "weighted alias," a developer can specify a percentage of invocations to be directed to the new version while the remaining traffic continues to hit the stable, current version. This enables canary deployments, where the new version can be monitored for errors or performance regressions with minimal impact before a full rollout.

  • ✓

    Create a new version of the Lambda function.

    Why this is correct

    When deploying updated code or configuration changes to an AWS Lambda function, it is essential to publish a new version. Lambda versions are immutable snapshots of the function code and configuration, ensuring consistency and allowing for easy rollback. Without creating a new version, the updated code cannot be associated with a distinct, addressable entity for deployment strategies like traffic shifting.

  • ✗

    Invoke the Lambda function with the new version using the AWS SDK.

    Why it's wrong here

    Directly invoking a specific Lambda function version using the AWS SDK only executes that particular version for the explicit invocation request. This action does not configure or manage the routing of general incoming traffic that typically targets an alias or the $LATEST version. Therefore, it does not facilitate a deployment strategy for shifting production traffic to a new version.

  • ✗

    Update the alias to route 100% of traffic to the new version.

    Why it's wrong here

    While an alias can be updated to route 100% of traffic to a new version, this approach bypasses the benefits of a gradual, controlled rollout. Immediately shifting all production traffic to an untested new version carries significant risk, as any unforeseen issues could lead to a complete service outage. Best practices for new deployments involve incremental traffic shifting to mitigate such risks.

  • ✗

    Use AWS CodeDeploy to create a deployment group for the Lambda function.

    Why it's wrong here

    While AWS CodeDeploy can orchestrate sophisticated deployments for Lambda functions, including automated traffic shifting and rollbacks, it is an external service that utilizes Lambda aliases to achieve these goals. The core mechanism for routing a percentage of traffic between Lambda versions resides within the Lambda alias configuration itself. Therefore, directly configuring the alias is the fundamental action for implementing this deployment strategy, rather than setting up an entire CodeDeploy pipeline as the primary step for a simple new version deployment.

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.