Courseiva
Deployment →mediumMultiple Select

DVA-C02 Deployment Practice Question

Which TWO actions should a developer take to ensure that an AWS CodeDeploy deployment is successful when deploying to an Auto Scaling group? (Choose TWO.)

⚠ Common exam trap

DVA-C02 often tests whether candidates confuse 'nice-to-have' deployment features (ALB, blue/green) with hard prerequisites (IAM service role, CodeDeploy agent) — the exam expects you to identify the minimum required configuration.

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

✓

Create an IAM service role that allows CodeDeploy to access the instances.

Option A is correct because CodeDeploy requires an IAM service role (the CodeDeploy service role) that grants it permissions to perform actions on the developer's behalf, such as reading tags, accessing S3 revision bundles, and calling EC2 Auto Scaling APIs to manage instances during deployment. Option E is correct because the CodeDeploy agent must be installed and running on each EC2 instance in the Auto Scaling group so the instance can poll CodeDeploy, receive the revision, and execute the deployment lifecycle event hooks (ApplicationStop, BeforeInstall, AfterInstall, ApplicationStart, ValidateService). Option B is not required because an Application Load Balancer is only needed for load-balanced or blue/green scenarios, not for a basic in-place deployment to an Auto Scaling group. Option C is incorrect because Application Discovery Service is used for migration planning and discovery, not for CodeDeploy deployments. Option D is not required because CodeDeploy supports in-place deployments to Auto Scaling groups, so blue/green is optional rather than mandatory.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Create an IAM service role that allows CodeDeploy to access the instances.

    Why this is correct

    Creating an IAM service role is mandatory because CodeDeploy uses this role to assume permissions to call Amazon EC2 and Auto Scaling APIs, letting it enumerate instances, read tags, and perform deployment actions. Without this role, CodeDeploy cannot even start a deployment or resolve the target instances in the Auto Scaling group, making it a fundamental prerequisite.

  • ✗

    Attach an Application Load Balancer to the Auto Scaling group.

    Why it's wrong here

    Attaching an Application Load Balancer is orthogonal to CodeDeploy's core operation; an ALB is useful for distributing traffic and for blue/green traffic shifting, but CodeDeploy can perform in-place deployments to instances behind either no load balancer or a classic ELB. It does not provide CodeDeploy with any access or deployment capability, so it is optional and not needed to ensure deployments succeed.

  • ✗

    Enable the Application Discovery Service for the instances.

    Why it's wrong here

    AWS Application Discovery Service collects metadata from on-premises servers to support migration and modernization planning, which has no connection to the CodeDeploy deployment pipeline. Enabling this service on EC2 instances would not install an agent nor grant CodeDeploy permissions; it simply adds unrelated telemetry and cost, so it cannot help ensure a deployment works.

  • ✗

    Configure the deployment to use a blue/green deployment type.

    Why it's wrong here

    Configuring a blue/green deployment type is a valid strategy but not a required action for basic CodeDeploy functionality; the default in-place deployment type works perfectly well with Auto Scaling groups and is often preferred when you want to minimize downtime or when instances are ephemeral. The question asks what must be done to enable deployments, and choosing a deployment type is a configuration choice, not a prerequisite.

  • ✓

    Install the CodeDeploy agent on each EC2 instance in the Auto Scaling group.

    Why this is correct

    The CodeDeploy agent must be installed and running on every target EC2 instance because it is the component that polls the CodeDeploy service, downloads the application revision, and executes the deployment lifecycle hooks. Without the agent, the instance never appears as healthy or ready, and the deployment fails or is skipped. For Auto Scaling groups, you should bake the agent into the AMI or install it via user data to handle scale-out events.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 1,135 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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

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.