Courseiva
Deployment →hardMultiple Choice

DVA-C02 Deployment Practice Question

A team uses AWS CodePipeline to deploy a microservices application to Amazon ECS. The pipeline has a Source stage (GitHub), a Build stage (CodeBuild), and a Deploy stage (ECS). During a deployment, the pipeline fails at the Deploy stage with the error: 'Action execution failed: Deployment failed. The service my-service has reached the maximum number of tasks.' The service is configured with a desired count of 2 and a maximum percent of 200%. What is the most likely cause of this failure?

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

✓

There are already 4 tasks running for the service, which is the maximum allowed by the deployment configuration.

With a desired count of 2 and a maximum percent of 200%, ECS allows up to 4 tasks during a deployment (2 × 200% = 4). If there are already 4 tasks running (e.g., from a previous deployment that did not complete or a manual scaling action), the new deployment cannot start additional tasks because it would exceed the maximum allowed. Option A is incorrect because insufficient memory would cause a different error, such as a task failing to start. Option C is incorrect because a high minimum healthy percent would prevent task replacement but would not directly cause a 'maximum number of tasks' error. Option D is incorrect because the error is about task count, not EC2 instance limits.

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 task definition references a memory value that exceeds the available container instance memory.

    Why it's wrong here

    If a task definition requests more memory than is available on the container instance, ECS would typically fail to place or launch the task, resulting in a `STOPPED` state with a reason like `CannotStartContainerError` or `Essential container in task exited` due to an Out Of Memory (OOM) event. This specific error, 'maximum tasks allowed by the deployment configuration,' indicates a limit imposed by the service's deployment settings, not an underlying resource exhaustion on the host.

  • ✓

    There are already 4 tasks running for the service, which is the maximum allowed by the deployment configuration.

    Why this is correct

    The `maximum healthy percent` deployment configuration parameter defines the upper limit on the number of tasks that can be running for a service during a deployment, expressed as a percentage of the desired task count. If the desired count is 2 and the maximum is 200%, then up to 4 tasks (2 * 200%) can run concurrently at any point. If 4 tasks are already active, the service cannot launch additional tasks for the new deployment, leading to the 'maximum tasks allowed' error.

  • ✗

    The service's minimum healthy percent is set too high, preventing new tasks from starting.

    Why it's wrong here

    The `minimum healthy percent` parameter specifies the minimum number of tasks that must remain in a healthy, running state during a deployment to maintain service availability. If this value is set too high, it might prevent the service from stopping old tasks or cause the deployment to fail if new tasks don't become healthy quickly enough. However, it does not directly limit the *total* number of tasks that can be launched; rather, it governs the *minimum* required for operational continuity.

  • ✗

    The pipeline is trying to deploy to an ECS cluster that has reached its Amazon EC2 instance limit.

    Why it's wrong here

    Reaching an Amazon EC2 instance limit within the ECS cluster would typically manifest as an `INSUFFICIENT_CAPACITY` error when ECS attempts to place new tasks or launch new container instances. This type of error signifies a lack of underlying compute resources at the cluster level. The message 'maximum tasks allowed by the deployment configuration' specifically points to a constraint within the ECS service's deployment strategy, not a broader infrastructure capacity issue.

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