Courseiva
DeploymenteasyMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A developer wants to deploy a serverless application using AWS CloudFormation. The application consists of an API Gateway, Lambda functions, and DynamoDB tables. The developer wants to ensure that the stack can be updated without resource interruption when possible. Which CloudFormation feature should the developer use?

⚠ Common exam trap

Watch out — candidates often confuse ChangeSets (which only preview changes) with the actual update mechanism, or they mistakenly think StackPolicies or Custom Resources can control update behavior, when in fact only the `DeploymentPreference` update policy on a Lambda alias provides the traffic-shifting capability needed for uninterrupted updates.

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 a Lambda alias with a DeploymentPreference update policy

The `DeploymentPreference` update policy on a Lambda alias enables canary, linear, or all-at-once traffic shifting during stack updates. This allows the developer to update Lambda function versions without interrupting existing invocations, as traffic is gradually routed to the new version while the old version continues to serve requests until the transition completes.

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 a Lambda alias with a DeploymentPreference update policy

    Why this is correct

    CloudFormation's `AWS::Lambda::Alias` resource, when combined with a `DeploymentPreference` update policy, facilitates controlled, gradual traffic shifting between a Lambda function's current version and a newly deployed version. This strategy leverages AWS CodeDeploy to manage the rollout, allowing for canary deployments or linear shifts, which ensures that updates are applied without service interruption by routing traffic incrementally and automatically rolling back if issues are detected.

  • Use a ChangeSet to review changes before applying them

    Why it's wrong here

    A CloudFormation Change Set provides a preview of the proposed modifications to your stack resources before they are actually implemented. While invaluable for understanding the impact of an update, it is purely a planning tool. Executing a Change Set still involves CloudFormation directly modifying resources, and if those modifications require recreating or temporarily disabling a resource, the Change Set itself offers no mechanism to prevent service interruption during that process.

  • Use a StackPolicy to protect critical resources

    Why it's wrong here

    A CloudFormation Stack Policy is designed to prevent unintended updates or deletions of specific resources within a stack, acting as a safeguard against accidental modifications to critical components. However, its purpose is protection, not graceful deployment. For resources *not* protected by the policy, or for updates that are explicitly allowed, the Stack Policy does not provide any mechanism to ensure zero-downtime updates or prevent service interruption during their modification.

  • Use a Custom Resource to manage updates

    Why it's wrong here

    CloudFormation Custom Resources allow you to write custom provisioning logic, typically using a Lambda function, to manage resources not natively supported by CloudFormation or to perform complex operations. While powerful for extending CloudFormation's capabilities, a Custom Resource merely executes custom code during stack operations. It does not inherently provide traffic shifting, blue/green deployment, or any other built-in mechanism to prevent service interruption for other resources being updated by the CloudFormation stack itself.

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 724 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.