Question

Difficulty: MediumAPI Development and Integration with Amazon API Gateway

An application team is designing a serverless API using Amazon API Gateway. The API must route incoming HTTP requests to a backend AWS Lambda function. The Lambda function requires access to the client request's HTTP headers, query string parameters, and API Gateway stage variables. To optimize development time, the team wants to implement this integration without writing or maintaining any custom mapping templates.

Which integration configuration should the developer choose to meet these requirements?

  1. Set the integration type to Lambda proxy integration for the API Gateway method.Answer
  2. B
    Set the integration type to Lambda custom integration and enable request body passthrough.
  3. C
    Set the integration type to HTTP proxy integration and configure a Cognito User Pool authorizer.
  4. D
    Set the integration type to AWS service integration, choose Lambda as the target service, and map request details to the integration request parameters.

Answer

Set the integration type to Lambda proxy integration for the API Gateway method.
The correct option is to set the integration type to Lambda proxy integration. With Lambda proxy integration, API Gateway passes the raw HTTP request directly to the backend Lambda function as a structured JSON object. This payload contains the body, headers, query string parameters, path parameters, stage variables, and request context. As a result, developers do not need to write or maintain VTL mapping templates, which satisfies the goal of minimizing configuration overhead.

Step-by-Step Solution

1
Analyze the requirements: the API must pass HTTP headers, query string parameters, and stage variables to the backend Lambda function.
Identify that mapping incoming request components is necessary.
This establishes the data components that need to be parsed by the backend.
2
Consider the design constraint: do not write or maintain custom VTL mapping templates.
Exclude integration types that require manual request template mapping.
This rules out custom integrations which rely on VTL mappings to inject metadata into the event payload.
3
Evaluate Lambda proxy integration features.
Verify that API Gateway automatically maps headers, query parameters, stage variables, and context into a standardized event structure.
Proxy integration fulfills all requirements out-of-the-box with zero configuration overhead.

Key Concept

Understanding the difference between Lambda Proxy and Lambda Custom integrations in API Gateway.
Rate this question