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?
- 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
- BCreate 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.
- CCreate 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.
- DCreate 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
Key Concept
AWS Fargate network modes and NAT Gateway high availability
Estimated Time:2m 0s