ALBEvent: {
    body: string;
    headers?: Record<string, string>;
    httpMethod: string;
    isBase64Encoded: boolean;
    multiValueHeaders?: Record<string, string[]>;
    multiValueQueryStringParameters?: Record<string, string[]>;
    path: string;
    queryStringParameters?: Record<string, string>;
    requestContext: { elb: { targetGroupArn: string } };
}

Zod schema for Application Load Balancer events.

Type declaration

  • body: string
  • Optionalheaders?: Record<string, string>
  • httpMethod: string
  • isBase64Encoded: boolean
  • OptionalmultiValueHeaders?: Record<string, string[]>
  • OptionalmultiValueQueryStringParameters?: Record<string, string[]>
  • path: string
  • OptionalqueryStringParameters?: Record<string, string>
  • requestContext: { elb: { targetGroupArn: string } }
{
"requestContext": {
"elb": {
"targetGroupArn": "arn:aws:elasticloadbalancing:region:123456789012:targetgroup/my-target-group/6d0ecf831eec9f09"
}
},
"httpMethod": "GET",
"path": "/",
"queryStringParameters": {
parameters
},
"headers": {
"accept": "text/html,application/xhtml+xml",
"accept-language": "en-US,en;q=0.8",
"content-type": "text/plain",
"cookie": "cookies",
"host": "lambda-846800462-us-east-2.elb.amazonaws.com",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)",
"x-amzn-trace-id": "Root=1-5bdb40ca-556d8b0c50dc66f0511bf520",
"x-forwarded-for": "72.21.198.66",
"x-forwarded-port": "443",
"x-forwarded-proto": "https"
},
"isBase64Encoded": false,
"body": "request_body"
}

With multi-value headers and multi-value query string parameters:

{
"requestContext": {
"elb": {
"targetGroupArn": "arn:aws:elasticloadbalancing:region:123456789012:targetgroup/my-target-group/6d0ecf831eec9f09"
}
},
"httpMethod": "GET",
"path": "/",
"multiValueHeaders": {
"Set-cookie": [
"cookie-name=cookie-value;Domain=myweb.com;Secure;HttpOnly",
"cookie-name=cookie-value;Expires=May 8, 2019"
],
"Content-Type": [
"application/json"
]
},
"isBase64Encoded": false,
"body": "request_body"
}