Courseiva

DOP-C02 Configuration Management and IaC Practice Question

A company uses AWS OpsWorks for configuration management. The DevOps team wants to run a custom recipe on all instances in a layer during stack updates. Which OpsWorks lifecycle event should they hook the recipe into?

⚠ Common exam trap

Many exam-takers confuse the Configure event (which runs on all instances during any state change) with the Setup event (which is specifically designed for initial and update-time configuration), leading them to pick Configure because it seems more broadly applicable.

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

✓

Setup

The Setup lifecycle event runs on every instance in a layer when it first boots or during a stack update, making it the correct hook for running a custom recipe that must execute on all instances during updates. This event occurs after the instance is fully configured and before it enters service, ensuring the recipe runs consistently across the layer.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Deploy

    Why it's wrong here

    The Deploy lifecycle event in AWS OpsWorks is triggered when you run the Deploy command on a stack, either manually or as part of a deployment. Its purpose is to deploy application code or run deployment-specific tasks like migrations, and it occurs after the instances are already running and configured. Since the question asks about initial configuration tasks that must happen when an instance first boots, Deploy is not the right choice; it is not invoked on boot unless a deploy action is explicitly initiated.

  • ✗

    Shutdown

    Why it's wrong here

    The Shutdown lifecycle event is executed when an instance is about to be stopped, terminated, or rebooted. It runs cleanup tasks such as stopping services, saving state, or deregistering the instance from a load balancer. This event is the opposite of boot-time setup; it occurs at the end of the instance's lifecycle, not at the start. Therefore, it cannot be used for initial configuration because the instance is already running and possibly already serving traffic.

  • ✗

    Configure

    Why it's wrong here

    The Configure lifecycle event runs whenever a configuration change occurs within the stack, such as when instances join or leave the stack, or when an instance's attribute changes. It is not tied to a specific instance's boot sequence; instead, it runs on all instances in a layer to inform them of topology changes. Using Configure for initial boot-time setup is insufficient because it might not run during a cold start of a new instance if no stack configuration changes are happening, and it is designed for dynamic updates, not one-time provisioning.

  • ✓

    Setup

    Why this is correct

    The Setup lifecycle event is specifically designed to run on an instance after it has been booted and registered with the stack, but before it is available. This event is intended for initial configuration tasks that need to happen only once, such as installing packages, creating directories, or setting up system users. In AWS OpsWorks, the Setup event is part of the standard lifecycle (Setup -> Configure -> Deploy -> Undeploy -> Shutdown) and is the correct lifecycle event for boot-time provisioning tasks, making it the answer to this question.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 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 →

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.