Q8 — AWS DVA-C02 Ch.3
Question 8 of 100 | ← Chapter 3
A developer is troubleshooting an Amazon API Gateway API. When a client attempts to access an endpoint of the API, the client receives an HTTP 400 response error. How can the developer determine the cause of these errors?
- A. Create an Amazon Kinesis Data Firehose delivery stream to receive API Gateway API call logs. Configure Amazon CloudWatch Logs as the delivery stream’s destination.
- B. Enable AWS CloudTrail Insights and create a trail. Specify the trail’s Amazon Resource Name (ARN) for the API’s stage.
- C. Enable AWS X-Ray for the API’s stage. Create an Amazon CloudWatch Logs log group. Specify the log group’s ARN for the API’s stage.
- D. Enable execution logging and access logging for the API’s stage and configure them to Amazon CloudWatch Logs. Create a CloudWatch Logs log group. Specify the log group’s ARN for the API’s stage. ✓
Correct Answer: D. Enable execution logging and access logging for the API’s stage and configure them to Amazon CloudWatch Logs. Create a CloudWatch Logs log group. Specify the log group’s ARN for the API’s stage.
Explanation
Option D recommends enabling execution logs and access logs for the API stage and configuring them to Amazon CloudWatch Logs, then creating a CloudWatch Logs log group and specifying its ARN for the API stage. This captures detailed API call information—including requests and responses—helping identify the root cause of HTTP 400 errors. Issues with other options: Option A’s Kinesis Data Firehose delivery stream, while capable of logging, is less direct than CloudWatch Logs for diagnosing HTTP 400 errors. Option B’s CloudTrail Insights focuses on security risk detection and prediction, not granular API request/response details. Option C’s AWS X-Ray provides distributed tracing but is more suited for application-level tracing and less effective than CloudWatch Logs for debugging API Gateway HTTP 400 errors.