DOP-C02 Configuration Management and IaC Practice Question
A DevOps team uses AWS OpsWorks for configuration management. They have a stack with a custom cookbook that installs and configures an application. After updating the cookbook on GitHub, they need to apply the changes to existing instances without creating new ones. What should the team do?
⚠ Common exam trap
Many exam-takers confuse updating the cookbook source (which only stages the new code) with actually executing the recipes, leading them to choose Option D, which does not apply the changes to running instances.
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 the 'Execute Recipes' feature to run the updated custom recipe on the instances.
AWS OpsWorks provides the 'Execute Recipes' feature, which allows you to run a specific recipe from a cookbook on existing instances without requiring a stack update or instance replacement. This is the direct method to apply changes from an updated custom cookbook to running instances, as it triggers Chef to execute the specified recipe immediately on the selected instances.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Clone the stack and assign the updated cookbook to the new stack.
Why it's wrong here
Cloning a stack in AWS OpsWorks creates a brand-new set of instances and configuration, but it does not modify any existing instances in the original stack. The updated cookbook would only be applied during the new stack's creation and initial setup, leaving your current instances unaffected. Therefore, this approach does not apply the updated custom recipe to the instances in question.
- ✓
Use the 'Execute Recipes' feature to run the updated custom recipe on the instances.
Why this is correct
The Execute Recipes feature in AWS OpsWorks Stacks allows you to run a specified recipe on selected instances immediately. This initiates an ad-hoc Chef run that pulls the latest cookbook from your configured source and executes the recipe's logic, directly applying the changes to the existing instances. It is the intended mechanism for manually applying cookbook updates without recreating or redeploying instances.
- ✗
Update the layer's custom cookbook settings and then reboot the instances.
Why it's wrong here
Simply updating the layer's custom cookbook settings changes the source reference for the layer, but it does not trigger a Chef run on the existing instances. Rebooting the instance restarts the operating system and any services, but it does not automatically execute Chef recipes; OpsWorks does not invoke lifecycle events upon reboot. Thus, this combination of actions fails to apply the updated recipe's changes to the instance configuration.
- ✗
Update the stack's custom cookbook source and click 'Update Dependencies' on the stack.
Why it's wrong here
Updating the stack's custom cookbook source refreshes the cookbook files on the instances, but the 'Update Dependencies' stack command does not execute any custom recipe—it only syncs package dependencies and cookbook code. Chef runs in OpsWorks are only triggered by lifecycle events or explicit execution, so simply updating the source and dependencies leaves the instances unchanged. To apply the updated recipe, you must explicitly run it via Execute Recipes or trigger a suitable lifecycle event.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 DOP-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 DOP-C02 exam.