# ALBRequestContext

**Kind:** Interface

**Source:** [`src/adapter/aws-lambda/types.ts`](https://github.com/honojs/hono/blob/main/src/adapter/aws-lambda/types.ts#L149)

**Part of:** [Adapter](subsystem-src-adapter)

`ALBRequestContext` describes the Application Load Balancer metadata attached to a request handled by the AWS Lambda adapter. Its `elb.targetGroupArn` field identifies the ALB target group that routed the request.

## Properties

| Property | Type |
|---|---|
| `elb` | `{ targetGroupArn: string }` |

## Diagram

```mermaid
graph LR
  Request[ALB Request] --> Context[ALBRequestContext]
  Context --> ELB[elb]
  ELB --> TargetGroupArn[targetGroupArn: string]
```

## Usage

```ts
import type { ALBRequestContext } from "./types";

function getTargetGroupArn(context: ALBRequestContext): string {
  return context.elb.targetGroupArn;
}

const context: ALBRequestContext = {
  elb: {
    targetGroupArn:
      "arn:aws:elasticloadbalancing:region:account:targetgroup/example/id",
  },
};

console.log(getTargetGroupArn(context));
```

## AI Coding Instructions

- Read the target group ARN from `context.elb.targetGroupArn`.
- Keep the `elb` object present when constructing an `ALBRequestContext`.
- Treat `targetGroupArn` as an ARN string; do not parse it unless the calling code needs a specific ARN component.
- Pass this context through AWS Lambda adapter code when request handling depends on ALB routing metadata.
