Q1 — AWS DVA-C02 Ch.2
Question 1 of 100 | ← Chapter 2
A developer is building an application that interacts with an AWS Lambda backend via an Amazon API Gateway API. The frontend team needs immediate access to the API endpoints to build the user interface. To prepare the backend for integration, the developer must configure endpoints that return predefined HTTP status codes and JSON responses to the frontend team. The developer has created a mock resource for the API. Which solution meets these requirements?
- A. Set the integration type to AWS_PROXY. Prepare the Lambda function to return hardcoded JSON data.
- B. Set the integration type to MOCK. Configure the method’s integration request and integration response to associate JSON responses with specific HTTP status codes. ✓
- C. Set the integration type to HTTP_PROXY. Configure API Gateway to forward all requests to an external placeholder API to be built by the team.
- D. Set the integration type to MOCK. Define HTTP status codes using method request. Define JSON responses using integration request.
Correct Answer: B. Set the integration type to MOCK. Configure the method’s integration request and integration response to associate JSON responses with specific HTTP status codes.
Explanation
Option B describes using the MOCK integration type, meaning API Gateway simulates the backend service and allows defining mock responses directly within API Gateway. By configuring the method’s integration request and integration response, you can explicitly associate JSON responses with specific HTTP status codes. This enables the developer to provide immediately usable API endpoints for the frontend team to build the UI while fulfilling the requirement for predefined HTTP status codes and JSON responses.