DVA-C02 Deployment Practice Question
A company uses AWS OpsWorks for configuration management. They want to deploy a new application version to a stack. Which lifecycle event should they use to run deployment scripts?
⚠ Common exam trap
Watch out — candidates often confuse the Deploy event with the Setup or Configure events, mistakenly thinking that code deployment happens during initial instance setup or configuration updates, rather than understanding that Deploy is the dedicated event for application version releases.
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
✓
Deploy
The Deploy lifecycle event in AWS OpsWorks is specifically designed to run deployment scripts when you deploy a new application version to a stack. This event occurs after the application code has been installed, allowing you to execute custom scripts for tasks like database migrations, cache clearing, or service restarts. It is the correct choice because it aligns with the deployment phase of the application lifecycle.
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
Why it's wrong here
The "Configure" event in AWS OpsWorks is triggered when an instance's configuration changes, such as when an instance is assigned to a layer, unassigned, or when an instance comes online or goes offline within a layer. It's primarily used to update instance configurations based on the current stack topology, ensuring all instances are aware of their neighbors and roles, not for deploying application code.
- ✗
Undeploy
Why it's wrong here
The "Undeploy" event is specifically designed to run when an application is removed or unassigned from an instance within an AWS OpsWorks layer. This lifecycle event typically executes recipes that clean up application-specific files, stop related services, or reverse any changes made during the deployment process, ensuring a clean removal. However, its purpose is cleanup, not initiating a new application deployment.
- ✗
Setup
Why it's wrong here
The "Setup" event is the very first lifecycle event that runs on an instance after it has successfully booted and registered with the AWS OpsWorks stack. Its primary purpose is to install base packages, configure system-wide settings, and prepare the instance for subsequent application deployments and operations. Therefore, while crucial for instance readiness, it is unsuitable for the actual deployment of an application's code.
- ✓
Deploy
Why this is correct
The "Deploy" event is the correct and designated lifecycle event in AWS OpsWorks for installing or updating an application on an instance. When this event is triggered, OpsWorks executes recipes designed to fetch application code from a specified repository, install necessary dependencies, configure web servers, and start application services. This ensures the application is correctly placed, configured, and made available to users.
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 →
Same concept, more angles
1 more way this is tested on DVA-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. 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?
medium- A.Update the custom cookbook and run the 'setup' command on the layer.
- B.Clone the stack and then delete the old stack.
- ✓ C.Update the app with the new version and run the 'deploy' command on the stack.
- D.Modify the Auto Scaling group to launch new instances with the updated app.
Why C: 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.
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.