A developer is configuring a REST API in Amazon API Gateway that integrates with an AWS Lambda function. The Lambda function must access the client's source IP address, a query string parameter named `storeId`, and a custom HTTP header named `X-Client-Device` from incoming requests. The developer wants to implement this with minimal configuration overhead and without writing mapping templates. Which two actions must the developer take to meet these requirements? (Select TWO.)
- Configure the API Gateway integration type as Lambda Proxy Integration.Cevap
- BDefine a Velocity Template Language (VTL) mapping template in the Integration Request to pass parameters.
- CCreate a custom Lambda Authorizer to extract the custom header and client IP and inject them into the request context.
- Access the client IP, query string parameter, and custom header directly from the event object inside the Lambda function code.Cevap
- EConfigure an API Gateway Integration Response mapping template to parse and format the return payload from the Lambda function.
Cevap
The developer should configure the API Gateway integration type as Lambda Proxy Integration and access the client IP, query string parameter, and custom header directly from the event object inside the Lambda function code.
Configuring the API Gateway integration type as Lambda Proxy Integration is correct because it passes all request metadata—including query string parameters, headers, and client connection context—directly to the backend Lambda function. Accessing these parameters from the event object inside the Lambda function handler is correct because the proxy integration formats the request as a structured JSON object, allowing direct extraction of the data within the function code without writing any VTL mapping templates.
Adım Adım Çözüm
Anahtar Kavram
API Gateway Lambda Proxy Integration vs Lambda Custom Integration
Tahmini Süre:1m 30s