Question

Difficulty: MediumModernizing Workloads using Containers (ECS and EKS)

A public transit agency, MetroTransit, is modernizing its real-time bus tracking application by migrating it from on-premises virtual machines to AWS. The application consists of an API gateway container and two backend processing containers that need to communicate with each other with sub-millisecond latency. The application also needs to fetch real-time weather updates from an external public API every minute. The system must be highly available and resilient to Availability Zone outages, and it must run with the least possible operational overhead. The Solutions Architect plans to deploy the application on Amazon ECS using the AWS Fargate launch type across two Availability Zones in a new VPC. Which design meets these requirements?

  1. Create a single ECS task definition containing all three containers. Configure the task to use the AWS Fargate launch type, which automatically uses the awsvpc network mode, allowing the containers to communicate over localhost. Deploy the tasks in private subnets across two Availability Zones, and deploy a NAT Gateway in each public subnet to provide redundant outbound connectivity.Answer
  2. B
    Create a single ECS task definition containing all three containers. Configure the network mode to bridge to allow the containers to communicate using the Docker bridge network. Deploy the tasks in private subnets across two Availability Zones, and deploy a NAT Gateway in each public subnet to provide redundant outbound connectivity.
  3. C
    Create a single ECS task definition containing all three containers. Configure the task to use the AWS Fargate launch type and use the host network mode to bind the containers directly to the host network namespace. Deploy the tasks in private subnets across two Availability Zones, and deploy a NAT Gateway in each public subnet to provide redundant outbound connectivity.
  4. D
    Create a single ECS task definition containing all three containers. Configure the task to use the AWS Fargate launch type, which automatically uses the awsvpc network mode, allowing the containers to communicate over localhost. Deploy the tasks in private subnets across two Availability Zones, and deploy a single NAT Gateway in one public subnet of one Availability Zone to route all outbound traffic.

Answer

Create a single ECS task definition containing all three containers. Configure the task to use the AWS Fargate launch type, which automatically uses the awsvpc network mode, allowing the containers to communicate over localhost. Deploy the tasks in private subnets across two Availability Zones, and deploy a NAT Gateway in each public subnet to provide redundant outbound connectivity.
The correct design uses a single ECS task definition containing all three containers on AWS Fargate. Fargate tasks run in the awsvpc network mode, where all containers within the task share the same network namespace and can communicate with each other over localhost with sub-millisecond latency. To ensure high availability and resilience to Availability Zone outages, tasks are deployed across multiple Availability Zones, and outbound internet access is routed through a dedicated NAT Gateway in each Availability Zone, preventing a single point of failure.

Step-by-Step Solution

1
Analyze container-to-container latency and deployment constraints.
To achieve sub-millisecond container-to-container latency, the containers should run within the same ECS task, allowing them to communicate over localhost. Fargate uses the awsvpc network mode, which enables this.
Running containers in the same task enables local loopback communication, avoiding network traversal over load balancers.
2
Select the correct network mode for AWS Fargate.
Recognize that AWS Fargate only supports the awsvpc network mode, ruling out bridge and host network modes.
Fargate abstracts the host, meaning traditional host and bridge networking configurations are not supported.
3
Evaluate high availability requirements for outbound internet traffic.
Determine that a NAT Gateway must be deployed in each public subnet across the two Availability Zones to prevent a single point of failure.
If a single NAT Gateway is used and its Availability Zone fails, tasks in other zones will lose outbound connectivity.

Key Concept

AWS Fargate network modes and NAT Gateway high availability
Estimated Time:2m 0s
Rate this question