Question

Difficulty: MediumAPI Development and Integration with Amazon API Gateway

A developer is configuring a serverless application where an Amazon API Gateway REST API integrates with an AWS Lambda function using Lambda proxy integration. Which of the following requirements must be met to ensure successful request processing and client response delivery? (Select TWO.)

  1. The Lambda function receives the client's HTTP request details, such as headers, query parameters, and payload, directly as the input event object.Answer
  2. B
    The developer must configure an integration request mapping template in API Gateway to transform the incoming request into the event format required by the Lambda function.
  3. The Lambda function must return a JSON response containing a statusCode integer and, if returning a payload, a body string.Answer
  4. D
    The developer must configure integration responses in API Gateway to map the return properties of the Lambda function to the final HTTP status codes.
  5. E
    The developer must implement a custom Lambda authorizer to extract and validate standard JSON Web Tokens (JWTs) issued by Amazon Cognito User Pools.

Answer

To configure a Lambda proxy integration successfully, the Lambda function receives the client's HTTP request details directly as the input event object, and it must return a properly structured JSON object that includes the statusCode and a stringified body.
The correct options state that the Lambda function receives the incoming request details directly in its event object and that it must return a JSON response with a statusCode and a body string. These are the core features of API Gateway's Lambda proxy integration.

Step-by-Step Solution

1
Analyze integration requirements for Lambda proxy integration.
Identify that API Gateway automatically maps the client request to the Lambda input event, so no request mapping templates are needed.
This is a fundamental behavior of Lambda proxy integration, where the full HTTP request details are passed directly to the backend.
2
Analyze response formatting requirements.
Confirm that the Lambda function must format its response output using a specific JSON structure (statusCode and body).
Because API Gateway does not map responses in proxy mode, the Lambda function itself must dictate the status code and payload directly.
3
Evaluate wrong options against the proxy integration model and authorization practices.
Discard options requiring request templates, custom integration responses, or unnecessary custom Lambda authorizers for Cognito.
Request/response mapping is associated with custom integrations, and standard Cognito JWT validation is natively supported by built-in authorizers.

Key Concept

API Gateway Lambda Proxy Integration behavior and requirements
Estimated Time:2m 0s
Rate this question