DOP-C02 Deployment group Practice Question
An organization is using AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment fails because the target group is not configured correctly. Which CodeDeploy component is responsible for registering instances with the load balancer?
⚠ Common exam trap
Candidates often incorrectly attribute instance registration to the AppSpec hooks section because hooks can run custom scripts. However, registration with a load balancer is a built-in function of CodeDeploy that relies on the deployment group configuration, not on user-defined hooks.
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
✓
The deployment group configuration
The deployment group configuration in AWS CodeDeploy specifies the target group or load balancer for the deployment. CodeDeploy automatically registers instances in the Auto Scaling group with the specified target group as part of the deployment process. The AppSpec file hooks section defines custom lifecycle event hooks for scripts, but instance registration is handled by the CodeDeploy service based on the deployment group settings, not by hooks.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The CodeDeploy agent configuration
Why it's wrong here
The CodeDeploy agent is a long-running process installed on each instance that polls the CodeDeploy service for deployment commands, executes the lifecycle hooks defined in the AppSpec file, and reports status back. It has no API access to Elastic Load Balancing and is not responsible for adding or removing instances from a target group. Load balancer registration is orchestrated by the CodeDeploy service itself using the deployment group's target group configuration.
- ✓
The deployment group configuration
Why this is correct
The deployment group configuration holds the load balancer or target group settings for the deployment. During an in-place or blue/green deployment, CodeDeploy automatically registers healthy instances with the target group defined in this configuration, and deregisters them before traffic shifts. It is this centrally defined setting, not anything in the application files or on the instance, that governs elastic load balancing integration.
- ✗
The AppSpec file hooks section
Why it's wrong here
The AppSpec file's hooks section maps lifecycle event names to scripts that run at specific points, such as BeforeInstall or ValidateService. These scripts run with instance privileges and could technically call AWS CLI to modify target groups, but that is not CodeDeploy's built-in registration mechanism. By default, hooks are for application deployment tasks, and automatic target group registration comes from deployment group settings, not from hook definitions.
- ✗
The application revision bundle
Why it's wrong here
The application revision bundle is the packaged source content, including the AppSpec file and any application artifacts, that CodeDeploy downloads to the instance. It contains no metadata about which load balancer or target group should be used, and its contents do not trigger registration with Elastic Load Balancing. The deployment group configuration is the component that supplies the target group ARN and controls the registration process, independent of the revision bundle's contents.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DOP-C02 question from scratch — 251 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 →
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.