Courseiva
DeploymentmediumMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A developer is deploying a serverless application using AWS SAM. The application includes an API Gateway endpoint backed by a Lambda function. The developer wants to enable canary deployments to shift 10% of traffic to the new version for 5 minutes before routing all traffic. Which configuration should the developer add to the SAM template?

⚠ Common exam trap

Many exam-takers confuse `Canary10Percent5Minutes` with `Linear10PercentEvery1Minute`, thinking both are canary deployments, but only the former holds traffic at 10% for a fixed duration before shifting all at once, while the latter shifts incrementally every minute.

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

DeploymentPreference with Type: Canary10Percent5Minutes

The `DeploymentPreference` property with `Type: Canary10Percent5Minutes` instructs AWS SAM to use AWS CodeDeploy to shift 10% of traffic to the new Lambda version for 5 minutes, then automatically route the remaining 90% after the canary period ends. This matches the requirement exactly, leveraging SAM's built-in integration with CodeDeploy for canary deployments.

Answer analysis

Option-by-option breakdown

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

  • DeploymentPreference with Type: Canary10Percent5Minutes

    Why this is correct

    For serverless applications deployed with AWS SAM, `DeploymentPreference` integrates with AWS CodeDeploy to manage traffic shifting. A `Canary10Percent5Minutes` strategy first routes 10% of traffic to the new Lambda function version for 5 minutes. If no alarms are triggered during this period, CodeDeploy automatically shifts the remaining 90% of traffic to the new version, providing a controlled rollout and minimizing impact from potential issues. This phased approach is ideal for validating new deployments in a production environment.

  • Add a CodeDeploy application and deployment group manually

    Why it's wrong here

    When using `DeploymentPreference` within an AWS SAM template for a serverless application, SAM automatically provisions and configures the necessary AWS CodeDeploy application, deployment group, and associated resources. Manually creating these components would be redundant and bypass the automated traffic shifting capabilities that SAM provides out-of-the-box. This approach contradicts the infrastructure-as-code paradigm and automation benefits of SAM.

  • DeploymentPreference with Type: Linear10PercentEvery1Minute

    Why it's wrong here

    The `Linear10PercentEvery1Minute` deployment strategy shifts traffic to the new Lambda function version in 10% increments every minute until 100% is reached. While this provides a gradual rollout, it differs from a canary strategy which holds a small percentage of traffic for a fixed duration. A linear shift might not provide the initial "bake time" for a small percentage of traffic that a canary deployment offers to detect immediate regressions before further increments.

  • DeploymentPreference with Type: AllAtOnce

    Why it's wrong here

    The `AllAtOnce` deployment strategy immediately shifts 100% of the traffic to the new Lambda function version without any phased rollout or monitoring period. While fast, this approach carries the highest risk for production serverless applications, as any issues introduced by the new version would immediately impact all users. It completely bypasses the safety mechanisms provided by gradual traffic shifting and automated rollbacks.

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 writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.