exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 221 discussion

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?

  • A. Remove the application from the ALB. Delete the ALB and change Amazon Route 53 to direct traffic to the instance running the application.
  • B. Remove the application from the ALCreate a Classic Load Balancer in its place. Direct traffic to the application using the HTTP protocol.
  • C. Alter the application code to inspect the X-Forwarded-For header. Ensure that the code can work properly if a list of IP addresses is passed in the header.
  • D. Alter the application code to inspect a custom header. Alter the client code to pass the IP address in the custom header.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
65703c1
5 months ago
Selected Answer: C
C is the correct answer.
upvoted 2 times
...
SerialiDr
9 months ago
Selected Answer: C
Use a Classic Load Balancer with HTTP protocol: While a Classic Load Balancer would also add the X-Forwarded-For header, there's no significant benefit in switching from an Application Load Balancer (ALB) to a Classic Load Balancer for this purpose. ALBs are generally preferred for application layer (HTTP/HTTPS) load balancing due to their advanced routing capabilities and other features.
upvoted 2 times
SerialiDr
9 months ago
C. Inspect the X-Forwarded-For header: This is the most appropriate solution. The X-Forwarded-For header is added by ALBs (and other types of load balancers) to HTTP requests and contains the original IP address of the client. Modifying the application to use this header allows it to obtain the client's IP address without removing the benefits of load balancing.
upvoted 3 times
...
...
Claire_KMT
12 months ago
C. Alter the application code to inspect the X-Forwarded-For header. Ensure that the code can work properly if a list of IP addresses is passed in the header.
upvoted 1 times
...
didorins
12 months ago
Selected Answer: C
If you need to see external IP address and your app is behind ALB, always use x-forwarded-for https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago