Courseiva
Resilient Cloud SolutionsmediumMultiple ChoiceObjective-mapped

Multi-AZ Task Placement for ECS Fargate

A company's application runs on Amazon ECS with Fargate launch type. The application must be resilient to an Availability Zone failure. Which configuration should be used?

Quick Answer

The correct configuration is to create an ECS service with tasks distributed across multiple Availability Zones using a spread placement strategy. This approach explicitly instructs ECS Fargate to place tasks evenly across AZs using the 'availabilityZone' dimension, ensuring that if one AZ fails, the remaining tasks in other zones continue serving traffic without interruption. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this tests your understanding that Fargate services do not automatically distribute tasks across AZs; you must define the placement strategy to achieve Multi-AZ resilience. A common trap is assuming that simply selecting multiple subnets in different AZs is enough—without the spread strategy, tasks may still be placed in a single AZ. For a quick memory tip, think "spread for steadiness": the spread placement strategy spreads tasks like butter across AZs, keeping your application steady even when one zone goes down.

⚠ Common exam trap

Many candidates confuse 'spread placement strategy' with 'binpack' or 'random' strategies, or they assume that simply using multiple subnets automatically distributes tasks without explicitly setting the spread strategy.

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 ECS service with tasks distributed across multiple Availability Zones using a spread placement strategy

ECS services using the Fargate launch type can distribute tasks across multiple Availability Zones (AZs) by defining a spread placement strategy with the 'availabilityZone' dimension. This ensures that if one AZ fails, the tasks in the other AZs continue to serve traffic, providing resilience to an AZ failure. The spread strategy explicitly instructs ECS to place tasks evenly across AZs, which is essential for high availability.

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 ECS service with tasks distributed across multiple Availability Zones using a spread placement strategy

    Why this is correct

    Spread strategy across AZs ensures resilience.

  • Use an ECS cluster with a cluster placement strategy that prefers the same Availability Zone

    Why it's wrong here

    Preferred same AZ reduces resilience.

  • Define multiple task definitions, one for each Availability Zone

    Why it's wrong here

    Unnecessary; service can spread tasks across AZs.

  • Use an ECS service with a single task in one Availability Zone and rely on auto-scaling

    Why it's wrong here

    Single AZ is a single point of failure.

About these practice questions

One of 251 original DOP-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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

5 more ways this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company runs a microservices application on Amazon ECS with Fargate. The services need to be resilient to AZ failures. Which TWO actions should the company take? (Choose two.)

medium
  • A.Configure the ECS service to spread tasks across multiple Availability Zones
  • B.Enable Service Auto Scaling to maintain desired count across AZs
  • C.Use a Network Load Balancer in each AZ for the service
  • D.Use a placement group to ensure tasks are launched on the same underlying hardware
  • E.Place all tasks in a single Availability Zone to minimize cross-AZ latency

Why A: To ensure resilience to Availability Zone failures, the company should spread tasks across multiple AZs (Option A) so that if one AZ fails, the tasks in other AZs continue to serve traffic. Additionally, enabling Service Auto Scaling (Option B) helps maintain the desired task count across AZs by automatically replacing tasks in failed AZs. Option C is incorrect because a single Network Load Balancer can route traffic across all AZs; placing one per AZ is unnecessary and adds complexity. Option D is irrelevant since placement groups apply to EC2 instances, not Fargate tasks. Option E is the opposite of resilience—placing all tasks in one AZ creates a single point of failure.

Variation 2. Which TWO strategies can be used to improve the resilience of an application running on Amazon ECS with Fargate? (Select TWO.)

medium
  • A.Use a single subnet for all tasks to simplify networking.
  • B.Configure the ECS service to place tasks in multiple Availability Zones.
  • C.Increase the task memory reservation to handle peak load.
  • D.Implement a circuit breaker pattern for downstream dependencies.
  • E.Use scheduled scaling to adjust task count based on historical patterns.

Why B: Configuring the ECS service to place tasks in multiple Availability Zones distributes the application across physically separate data centers, so if one AZ fails, the tasks in other AZs continue to run. Option D is correct because implementing a circuit breaker pattern for downstream dependencies prevents cascading failures by detecting faults and failing fast, allowing the system to recover gracefully. Option A is incorrect; using a single subnet for all tasks typically places them in a single Availability Zone, reducing fault tolerance. Option C is incorrect; increasing task memory reservation helps handle peak load but does not improve resilience against failures. Option E is incorrect; scheduled scaling adjusts capacity based on historical patterns and does not handle unexpected spikes or failures.

Variation 3. A company uses Amazon ECS with Fargate for containerized applications. They need to ensure that if a task fails, it is automatically restarted and the application remains available. Which THREE actions should they take? (Choose THREE.)

hard
  • A.Configure the ECS service to automatically restart failed tasks.
  • B.Place tasks across multiple Availability Zones.
  • C.Use an Application Load Balancer with health checks.
  • D.Set up a CloudWatch alarm to trigger AWS Lambda to restart tasks.
  • E.Configure an EC2 Auto Scaling group for the ECS cluster.

Why A: Amazon ECS services can be configured with a desired task count and a task placement strategy that automatically replaces any failed or stopped tasks. When a task exits unexpectedly, the ECS service scheduler detects the discrepancy between the desired and running count and launches a new task to maintain availability. This is the native mechanism for self-healing in ECS, without requiring external triggers.

Variation 4. A company runs a critical microservices architecture on Amazon ECS with Fargate. They want to ensure that if a task fails, it is automatically restarted, and the service remains available across multiple Availability Zones. How should they configure the ECS service?

hard
  • A.Place all tasks in the same Availability Zone to reduce latency
  • B.Run a standalone Fargate task and use a CloudWatch alarm to restart it
  • C.Use an EC2 launch type with a single instance to reduce complexity
  • D.Define an ECS service with a task definition, set desired count across multiple Availability Zones, and use Service Auto Scaling

Why D: An ECS service configured with a task definition, desired count across multiple Availability Zones, and Service Auto Scaling ensures resilience. The ECS service scheduler automatically restarts failed tasks, and distributing tasks across AZs provides high availability. Option A is wrong because placing all tasks in a single AZ creates a single point of failure. Option B is wrong because a standalone Fargate task does not have automatic restart; a CloudWatch alarm can restart it but lacks the built-in resilience of an ECS service. Option C is wrong because using a single EC2 instance is a single point of failure and does not provide multi-AZ resilience.

Variation 5. A company runs a microservices architecture on Amazon ECS with Fargate. Each service is deployed in its own ECS service. The company wants to ensure that if one Availability Zone (AZ) fails, the services can continue to operate with minimal impact. What is the MOST resilient task placement strategy?

hard
  • A.Use a task placement constraint to run tasks on distinct instances.
  • B.Use a task placement strategy that uses the random algorithm.
  • C.Use a task placement strategy that uses the binpack algorithm to maximize resource utilization.
  • D.Use a task placement strategy that spreads tasks across Availability Zones.

Why D: The 'spread across Availability Zones' strategy explicitly distributes ECS tasks across multiple AZs, ensuring that if one AZ fails, the remaining AZs continue to run the service. This is the most resilient approach for Fargate tasks, as it leverages the AZ isolation provided by AWS to minimize the blast radius of a single-AZ failure.

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.