DVA-C02 Deployment Practice Question
A company uses AWS CloudFormation to manage infrastructure. The development team wants to deploy a new version of a Lambda function without downtime. The function is part of a stack. Which action should the team take?
⚠ Common exam trap
The trap here is that candidates mistakenly think manual changes (Option C) or creating a new stack (Option D) are safer, but CloudFormation's stack update is designed for zero-downtime deployments, and manual edits cause drift that CloudFormation will revert.
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 CloudFormation stack with the new function code and deploy the stack update.
Updating the CloudFormation stack with the new Lambda function code and deploying the stack update is the correct approach because CloudFormation performs a rolling update on the Lambda function, replacing the old version with the new one without deleting the stack. This ensures zero downtime as the update is applied in place, and the function remains available throughout the process.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a change set and execute it after the current stack is deleted.
Why it's wrong here
Deleting the current CloudFormation stack before attempting to apply updates will inevitably lead to service downtime, as all resources managed by the stack, including the Lambda function, will be removed. Furthermore, CloudFormation change sets are specifically designed to preview and apply modifications to *existing* stacks, not to create new resources after a stack has been deleted. This approach introduces unnecessary downtime and fundamentally misuses the change set functionality.
- ✓
Update the CloudFormation stack with the new function code and deploy the stack update.
Why this is correct
The most appropriate and robust method is to update the existing CloudFormation stack by modifying the Lambda function's code within the template and then deploying the stack update. CloudFormation intelligently handles the deployment, often creating new versions of the Lambda function and potentially updating aliases, which can be orchestrated to achieve zero-downtime deployments. This approach maintains infrastructure as code principles and leverages CloudFormation's native, controlled update capabilities.
- ✗
Manually update the Lambda function code in the console and then update the stack.
Why it's wrong here
Manually updating the Lambda function code directly in the AWS console creates "drift" between the deployed resources and the CloudFormation template, violating the infrastructure as code principle. While the function might temporarily run the new code, the CloudFormation stack's state would not reflect this change. A subsequent stack update from the original template would likely overwrite these manual modifications, causing unexpected behavior or reverting to an older, unintended version.
- ✗
Create a new CloudFormation stack for the new function and delete the old stack.
Why it's wrong here
Creating an entirely new CloudFormation stack for the updated Lambda function and then deleting the old one introduces unnecessary complexity and guaranteed downtime. During the period when the old stack is being deleted and the new one is being provisioned and switched over, the service would be unavailable. This method bypasses CloudFormation's robust in-place update capabilities, which are designed to manage resource changes efficiently without requiring full re-provisioning.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
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 →
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.