DVA-C02 Deployment Practice Question
A company uses AWS OpsWorks for configuration management. They have a stack with multiple layers. They want to deploy a new application version to the application layer using rolling updates. What is the correct way to achieve this?
⚠ Common exam trap
Watch out — candidates often confuse the 'setup' lifecycle event (used for initial configuration) with the 'deploy' lifecycle event (used for application deployment), leading candidates to incorrectly choose Option A instead of C.
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 app with the new version and run the 'deploy' command on the stack.
In AWS OpsWorks, deploying a new application version to a layer is done by updating the app configuration with the new version and then running the 'deploy' command on the stack. This command triggers the built-in Chef deploy recipes on the layer's instances, performing a rolling update that installs the new application version while minimizing downtime. The 'deploy' lifecycle event is specifically designed for application deployment, unlike 'setup' which configures the instance's initial state.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Update the custom cookbook and run the 'setup' command on the layer.
Why it's wrong here
Updating a custom cookbook and running the 'setup' command on a layer is incorrect for deploying a new application version. The 'setup' lifecycle event primarily executes recipes for initial instance configuration, such as installing packages and setting up services, when an instance first boots or is added to a layer. It does not trigger the deployment of an updated application version to instances that are already running and have a previous application deployed.
- ✗
Clone the stack and then delete the old stack.
Why it's wrong here
Cloning an AWS OpsWorks stack and then deleting the old one is an overly disruptive and inefficient method for deploying a new application version. This approach creates an entirely new, separate stack with its own resources, requiring a full migration or cutover rather than an in-place update. It is not designed for rolling updates or seamless application version deployments within an existing operational environment.
- ✓
Update the app with the new version and run the 'deploy' command on the stack.
Why this is correct
The correct procedure involves updating the application definition within the AWS OpsWorks stack to point to the new version's source, such as a new Git commit or S3 object. Subsequently, executing the 'deploy' command on the stack or a specific layer triggers the 'deploy' lifecycle event across all instances. This command instructs OpsWorks to pull the updated application code and run the associated deployment recipes, ensuring the new version is installed and services are restarted as configured.
- ✗
Modify the Auto Scaling group to launch new instances with the updated app.
Why it's wrong here
Modifying an Auto Scaling group to launch new instances with the updated app is insufficient for deploying a new application version in AWS OpsWorks. While Auto Scaling manages the number of instances, it does not inherently handle application deployment logic. New instances launched by Auto Scaling within an OpsWorks layer will execute the layer's 'setup' recipes, but they will not automatically pull and deploy a new application version without an explicit OpsWorks 'deploy' command being issued.
Go deeper
Related to this question
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 →
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.