exam questions

Exam AWS Certified Developer Associate All Questions

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

Exam AWS Certified Developer Associate topic 1 question 104 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 104
Topic #: 1
[All AWS Certified Developer Associate Questions]

A developer is writing an application to analyze the traffic to a fleet of Amazon EC2 instances. The EC2 instances run behind a public Application Load Balancer
(ALB). An HTTP server runs on each of the EC2 instances, logging all requests to a log file.
The developer wants to capture the client public IP addresses. The developer analyzes the log files and notices only the IP address of the ALB.
What must the developer do to capture the client public IP addresses in the log file?

  • A. Add a Host header to the HTTP server log configuration file.
  • B. Install the Amazon CloudWatch Logs agent on each EC2 instance. Configure the agent to write to the log file.
  • C. Install the AWS X-Ray daemon on each EC2 instance. Configure the daemon to write to the log file.
  • D. Add an X-Forwarded-For header to the HTTP server log configuration file.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
cloud_collector
Highly Voted 2 years, 6 months ago
Selected Answer: D
The X-Forwarded-For request header helps you identify the IP address of a client when you use an HTTP or HTTPS load balancer. Because load balancers intercept traffic between clients and servers, your server access logs only contain the IP address of the load balancer. https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html#x-forwarded-for
upvoted 6 times
...
sumanshu
Most Recent 4 months, 1 week ago
Selected Answer: D
This header is automatically added by the ALB and contains the original client IP address before the request was forwarded.
upvoted 1 times
...
RachitNandi1997
1 year, 8 months ago
Selected Answer: C
C is the correct answer.
upvoted 1 times
...
AswinDe
1 year, 9 months ago
Selected = D. it is correct.
upvoted 1 times
...
rcaliandro
1 year, 10 months ago
Selected Answer: D
Of course the right answer is D. Since the request always comes from the ALB, if we directly read the IP addres it will not change frequently and will be the same in most of the cases. But if we want to capture the client IP address we must use the header "X-Forwarded-For" from the request and then log the value.
upvoted 1 times
...
pancman
2 years, 1 month ago
Saw this question in the exam today (Feb 2023)
upvoted 2 times
...
michele_scar
2 years, 3 months ago
Selected Answer: D
The way to log IP from ALB request is to use X-Forwarded-For header
upvoted 2 times
...
sichilam
2 years, 3 months ago
D it is
upvoted 1 times
...
RUKSHANA
2 years, 7 months ago
D https://aws.amazon.com/premiumsupport/knowledge-center/elb-capture-client-ip-addresses/
upvoted 3 times
...
m_t_kd
2 years, 7 months ago
D- X-Forwarded-For header will help
upvoted 3 times
...
Chhotu_DBA
2 years, 7 months ago
Selected Answer: D
This is D
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