DVA-C02 Deployment Practice Question
A company uses AWS CodePipeline to deploy a Node.js application to AWS Elastic Beanstalk. The build stage runs successfully, but the deploy stage fails with an error: 'The deployment failed because no instances were found for the environment.' What is the most likely cause?
⚠ Common exam trap
It's easy for candidates to confuse the error with a permissions or artifact issue, but the specific wording 'no instances were found' points directly to the Elastic Beanstalk environment's instance count, not to IAM roles or build outputs.
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 Elastic Beanstalk environment has no running instances due to a failed health check.
The error 'no instances were found for the environment' directly indicates that the Elastic Beanstalk environment has no running EC2 instances. This typically occurs when the environment's health checks have failed, causing all instances to be terminated or remain in a degraded state. Without any healthy instances, CodePipeline cannot deploy the application, as Elastic Beanstalk requires at least one running instance to perform a deployment.
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 application is not configured correctly.
Why it's wrong here
Elastic Beanstalk environments manage their own application deployments using an agent on the EC2 instances, processing application versions uploaded to S3. AWS CodeDeploy is a separate deployment service primarily used for custom deployments to EC2 instances, on-premises servers, or AWS Lambda, and is not the default or primary mechanism for deploying applications within a standard Elastic Beanstalk environment. Therefore, issues with CodeDeploy configuration are irrelevant to a typical Elastic Beanstalk deployment failure.
- ✗
The IAM role for CodePipeline lacks permissions to describe EC2 instances.
Why it's wrong here
If the IAM role assumed by CodePipeline lacked the necessary permissions, such as `ec2:DescribeInstances`, the pipeline would fail with an explicit "Access Denied" error. This error would occur during the initial phase where CodePipeline attempts to gather information about the target environment. The message "no instances found" implies that the service *was* able to query for instances but found zero available, rather than being blocked from performing the query altogether.
- ✗
The build artifact is not named correctly for Elastic Beanstalk.
Why it's wrong here
An incorrect build artifact name or structure for Elastic Beanstalk would typically result in a deployment error indicating an invalid application bundle, a failure to extract the contents, or an inability to locate the application source. For example, if the `.zip` file is malformed or missing required files, Elastic Beanstalk would report issues with the application version itself. It would not lead to an error message stating that no instances were found to deploy to, as the problem lies with the deployable package, not the target infrastructure.
- ✓
The Elastic Beanstalk environment has no running instances due to a failed health check.
Why this is correct
If an Elastic Beanstalk environment's instances consistently fail health checks (e.g., application not responding on the configured port, high resource utilization), the underlying Auto Scaling group will terminate them. If new instances launched by Auto Scaling also fail to become healthy, the environment can enter a degraded state with zero healthy, running instances. In this scenario, when CodePipeline attempts to deploy a new application version, it correctly reports "no instances found" because there are no available, healthy targets to receive the deployment.
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-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 →
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.