Dung (Donny) Nguyen

Senior Software Engineer

Lambda Proxy Integration

Lambda proxy integration is a powerful feature of Amazon API Gateway that allows you to directly pass the entire HTTP request from API Gateway to your AWS Lambda function. This gives your function full control over handling the request and crafting the response.

Here’s a breakdown of how it works and why it’s useful:


🔄 What Is Lambda Proxy Integration?

Lambda proxy integration is a mode in API Gateway where:


🧾 Request Format

When using proxy integration, the Lambda function receives an event object like this:

{
  "resource": "/{proxy+}",
  "path": "/example/path",
  "httpMethod": "GET",
  "headers": { ... },
  "queryStringParameters": { ... },
  "pathParameters": { ... },
  "body": "{...}",
  "isBase64Encoded": false
}

This gives your function full visibility into the HTTP request.


📤 Response Format

Your Lambda function must return a response in this format:

{
  "statusCode": 200,
  "headers": {
    "Content-Type": "application/json"
  },
  "body": "{\"message\": \"Hello World\"}",
  "isBase64Encoded": false
}

This allows you to control the HTTP status code, headers, and body content.


✅ Benefits


⚠️ Considerations