AWS Certified Developer – Associate — Question 425

An application needs to use the IP address of the client in its processing. The application has been moved into AWS and has been placed behind an Application
Load Balancer (ALB). However, all the client IP addresses now appear to be the same. The application must maintain the ability to scale horizontally.
Based on this scenario, what is the MOST cost-effective solution to this problem?

Answer options

Correct answer: C

Explanation

When traffic passes through an Application Load Balancer (ALB), the target instances see the ALB's IP address instead of the client's IP address, which the ALB automatically appends to the X-Forwarded-For request header. Modifying the application code to read this header is the most cost-effective solution because it requires no infrastructure changes and preserves horizontal scaling. Removing the ALB or changing the load balancer type would either break horizontal scaling or increase management complexity without solving the root issue as effectively.