Courseiva
Configuration Management and IaCeasyMultiple ChoiceObjective-mapped

DOP-C02 Configuration Management and IaC Practice Question

A company uses AWS OpsWorks for configuration management. The operations team needs to apply a configuration change to all instances in a layer without downtime. Which approach should they use?

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 custom Chef recipe and run it on the layer using OpsWorks 'Run Command'.

The correct approach is to use a custom Chef recipe and run it on the layer using OpsWorks 'Run Command'. This allows applying configuration changes to all instances in the layer without downtime, as OpsWorks executes the recipe on each instance without requiring instance recreation. Option B is incorrect because Auto Scaling lifecycle hooks are used to execute actions during instance launch or termination, not for runtime configuration updates. Option C is incorrect because cloning a layer creates a new layer and does not apply changes to existing instances; switching traffic would involve additional steps and potential downtime. Option D is incorrect because manually SSHing into each instance is error-prone, not scalable, and violates best practices for configuration management.

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 custom Chef recipe and run it on the layer using OpsWorks 'Run Command'.

    Why this is correct

    Use a custom Chef recipe and run it on the layer using OpsWorks 'Run Command' is correct because OpsWorks Stacks can execute a recipe on any currently online instance without waiting for a lifecycle event. This converges the specified layer's existing instances to the updated configuration immediately, and Chef's idempotent execution ensures only necessary changes are applied. You can target a single instance, a whole layer, or use custom Chef JSON to pass parameters.

  • Use an Auto Scaling lifecycle hook to apply the change during instance launch.

    Why it's wrong here

    An Auto Scaling lifecycle hook fires only when EC2 Auto Scaling creates or terminates instances, putting newly launched instances into a wait state until the hook completes. Existing instances that are already running and managed by OpsWorks will never trigger the launch hook, so the configuration change would not be applied to your current fleet. Additionally, the hook would need to launch a new instance to have any effect, which is not the same as remediating the existing instances.

  • Clone the layer and update the clone with the new configuration, then switch traffic.

    Why it's wrong here

    Cloning the layer duplicates its configuration, cookbooks, and settings into a fresh layer, but it does not modify or update the original layer's running instances. Even if you shift traffic to the cloned layer, the old instances remain online in the original layer with the old configuration unless you manually deregister, stop, or rebuild them. This approach would address new capacity but leaves the original instances in a stale, undesired state, so it cannot serve as the immediate fix.

  • SSH into each instance and manually apply the change.

    Why it's wrong here

    Manually SSHing into each instance and applying the change is error-prone and non-reproducible, and because OpsWorks Stacks enforces Chef-managed convergence, the next Deploy, Setup, or Configure lifecycle event will likely revert or overwrite the manual edit. This process does not scale to fleets, leaves no auditable change record, and bypasses the configuration-management model that OpsWorks provides. Any manual change is also not captured in a recipe, so it cannot be consistently re-applied to new instances.

About these practice questions

One of 1,339 original DOP-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 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.