Courseiva
Question 233 of 724
DeploymenthardMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A developer is deploying a multi-container Docker application on Amazon ECS using the Fargate launch type. The application consists of a web server and a background worker. The web server must be scaled independently and must be accessible from the internet via an Application Load Balancer. The worker should not be accessible from the internet. Which ECS configuration should the developer use?

⚠ Common exam trap

Many candidates assume containers in the same task definition can be independently scaled or that service discovery alone provides network isolation, but in ECS, containers in the same task share the same resources and scaling lifecycle, and service discovery does not restrict internet access.

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 two separate ECS services, each with its own task definition, and place the web server in a public subnet with the worker in a private subnet.

It uses two separate ECS services, each with its own task definition, allowing independent scaling of the web server and worker. Placing the web server in a public subnet with an Application Load Balancer makes it internet-accessible, while the worker in a private subnet is isolated from direct internet traffic, meeting the security requirement.

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 one ECS service with both containers in the same task definition, but only expose the web server port.

    Why it's wrong here

    If both containers are defined within the same task definition and managed by a single ECS service, they will always be deployed together on the same underlying compute resource (EC2 instance or Fargate task). This tightly couples their lifecycle and scaling, preventing independent scaling of the web server and worker components based on their individual load. Furthermore, placing this single task in a public subnet to expose the web server would inadvertently expose the worker container to the public internet, which is a significant security risk and poor architectural practice for backend processing.

  • Create two separate ECS services, each with its own task definition, and place the web server in a public subnet with the worker in a private subnet.

    Why this is correct

    This approach correctly leverages ECS services for independent lifecycle management and scaling of distinct application components. By defining separate task definitions and services for the web server and worker, each can be scaled independently based on its specific load requirements, optimizing resource utilization. Placing the web server service in a public subnet, typically behind an Application Load Balancer, allows it to serve internet traffic, while the worker service in a private subnet ensures it remains isolated from direct public access, enhancing security and adhering to best practices for backend components.

  • Create one ECS service with two tasks, each containing one container.

    Why it's wrong here

    An ECS service is designed to manage a desired count of tasks based on a *single* specified task definition. Therefore, the concept of "one ECS service with two tasks, each containing one container" implies that the service would be running two instances of the same task definition, or it fundamentally misunderstands how services and task definitions relate. Even if it were possible to configure a single service to manage tasks from different task definitions, that service would still apply uniform scaling policies and network configuration to all its managed tasks, preventing independent scaling or distinct subnet placement for the web server and worker components.

  • Create one ECS service with two containers in the same task, and use a service discovery to expose the worker.

    Why it's wrong here

    While AWS Cloud Map service discovery provides internal DNS resolution for services, it does not address the fundamental architectural issues of placing both containers in the same task definition within a single ECS service. This configuration still forces the web server and worker to scale together and share the same network placement. Consequently, if the task is placed in a public subnet to expose the web server, the worker container would also be exposed, regardless of service discovery, which is intended for internal communication, not external exposure or security segmentation.

Visual reference

192.168.1.0 /24 256 addresses (254 usable) 192.168.1.0 /25 Subnet A 128 addr (126 usable) 192.168.1.128 /25 Subnet B 128 addr (126 usable) Borrowing 1 bit from host portion creates 2 subnets (/25)

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.