ANS-C01 Question 88
Single answerYou are designing an architecture where you need to route TCP traffic to containers running on Amazon ECS using dynamic port mapping. Which target type should you choose when configuring the load balancer target group?
- A
Instance
- B
IP
- C
TCP
- D
GENEVE
Show answer and explanation
Correct answer: B
Explanation
When using ECS with dynamic port mapping, the container's host port is dynamically assigned at runtime. To correctly route traffic to these containers, the target type 'IP' must be used so that the load balancer can forward traffic directly to the container's IP address and port. Using 'Instance' would incorrectly route traffic to the EC2 instance instead of the container, and 'TCP' and 'GENEVE' are not valid target type options.
- A. Incorrect.
Choosing 'Instance' as the target type routes traffic to the EC2 instance hosting the containers, not directly to the dynamically assigned container ports. This would not work for ECS tasks with dynamic port mapping.
- B. Correct.
Choosing 'IP' as the target type allows traffic to be routed directly to the container's IP address, even when dynamic port mapping is used, making it the correct option for this scenario.
- C. Incorrect.
TCP is not a target type but a protocol. While TCP traffic can be routed, this option does not correctly address the configuration of the target type.
- D. Incorrect.
GENEVE is a protocol used by AWS Nitro Enclaves and is not relevant to configuring a load balancer target group for ECS containers.