You have an AWS Lambda function integrated with an API Gateway using the default proxy integration. When a client sends a request, what will the Lambda function receive as its event parameter?
Think about what information API Gateway sends to Lambda in proxy integration.
In proxy integration, API Gateway sends a detailed JSON event to Lambda including HTTP method, headers, path, query parameters, and the body as a string. This allows Lambda to handle the entire HTTP request.
You want to integrate an AWS Lambda function with API Gateway. You need to support multiple HTTP methods and want API Gateway to handle request validation and transformation. Which integration type should you choose?
Consider which integration type allows API Gateway to manage request validation and mapping templates.
Lambda non-proxy (custom) integration lets API Gateway handle request validation, transformation, and mapping templates before invoking Lambda. Proxy integration passes the entire request to Lambda without transformation.
You want to secure your Lambda function behind API Gateway so that only authenticated users can invoke it. Which of the following is the best way to enforce authentication at the API Gateway level?
Think about where to enforce authentication to reduce Lambda load.
API Gateway Lambda authorizers validate tokens before invoking Lambda, preventing unauthorized requests early. IAM policies control AWS resource access but are less flexible for user authentication. Authentication inside Lambda increases latency and cost.
You have a Lambda function integrated with API Gateway using non-proxy integration. Your Lambda returns a JSON with a statusCode and body. How do you configure API Gateway to map the Lambda response to an HTTP 200 status with the body content?
Consider how API Gateway handles Lambda responses in non-proxy integration.
In non-proxy integration, API Gateway requires mapping templates in Integration Response to extract the body and set the HTTP status code. Proxy integration handles this automatically.
You have a high-traffic API Gateway endpoint integrated with Lambda proxy integration. You notice increased latency and cold starts. Which approach best reduces latency and cold starts?
Think about how to keep Lambda functions warm and improve execution speed.
Increasing memory size can improve Lambda execution speed. Provisioned concurrency keeps Lambda instances initialized to avoid cold starts. Non-proxy integration does not reduce cold starts. Retries increase latency. Caching helps but indefinite caching is not practical for dynamic data.