Question

Difficulty: EasyAPI Development and Integration with Amazon API Gateway

A developer is configuring a REST API in Amazon API Gateway using a Lambda proxy integration with a backend AWS Lambda function. Which two requirements or behaviors apply to this integration type? (Select TWO.)

  1. The Lambda function response must be formatted as a JSON object with statusCode, headers, and body keys.Answer
  2. API Gateway passes the entire client HTTP request to the Lambda function as a structured event parameter.Answer
  3. C
    The developer must configure mapping templates in API Gateway to format the request payload before it reaches the Lambda function.
  4. D
    The developer must configure integration response mappings in API Gateway to bind function returns to specific HTTP status codes.
  5. E
    The developer must configure a custom Lambda authorizer to handle user authentication via Amazon Cognito User Pools.

Answer

The correct options are that the Lambda function response must be formatted as a JSON object with statusCode, headers, and body keys, and API Gateway passes the entire client HTTP request to the Lambda function as a structured event parameter.
In a Lambda proxy integration, API Gateway automatically forwards the entire HTTP request to the Lambda function as a structured event object, and the Lambda function must return the response in a specific JSON format containing statusCode, headers, and body keys.

Step-by-Step Solution

1
Analyze the integration type configured in API Gateway.
The integration is identified as a Lambda Proxy Integration.
This choice of integration dictates how data is passed and how responses must be structured.
2
Evaluate how API Gateway handles incoming request details under this integration model.
API Gateway automatically forwards all request details (headers, query parameters, path variables, and body) directly to the Lambda function inside the event payload without template mappings.
This is a native behavior designed to simplify request handling on the API Gateway side.
3
Evaluate how the backend Lambda function must return its output.
The function must return a JSON object with the specific structure containing statusCode, headers, and body so API Gateway knows how to construct the HTTP response.
This shifts the responsibility of defining HTTP status codes and headers from API Gateway's integration settings to the application code in Lambda.

Key Concept

API Gateway Lambda Proxy Integration behavior and requirements
Rate this question