Courseiva
DeploymentmediumMultiple SelectObjective-mapped

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.)

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.

The correct actions are to create an IAM service role that allows CodeDeploy to access the instances (Option A) and install the CodeDeploy agent on each EC2 instance in the Auto Scaling group (Option E). The service role grants CodeDeploy the necessary permissions to deploy to the instances, and the agent must be running on each instance to receive and execute deployment commands. Option B is not required; a load balancer is optional and not necessary for successful deployments. Option C is irrelevant; the Application Discovery Service is used for discovery and migration planning, not for CodeDeploy. Option D is not required; CodeDeploy supports both in-place and blue/green deployments, but the question does not specify which type, and a blue/green deployment is not mandatory for success.

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.

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 724 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 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.