# LatticeRequestContextV2

**Kind:** Interface

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

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

`LatticeRequestContextV2` represents request metadata added by AWS VPC Lattice in the Lambda adapter. It contains service and target identifiers, the request region and timestamp, plus optional caller identity attributes.

## Properties

| Property | Type |
|---|---|
| `serviceNetworkArn` | `string` |
| `serviceArn` | `string` |
| `targetGroupArn` | `string` |
| `region` | `string` |
| `timeEpoch` | `string` |
| `identity` | `{ sourceVpcArn?: string type?: string principal?: string principalOrgID?: string sessionName?: string x509IssuerOu?: string x509SanDns?: string x509SanNameCn?: string x509SanUri?: string x509SubjectCn?: string }` |

## Diagram

```mermaid
graph LR
  Request[VPC Lattice request] --> Context[LatticeRequestContextV2]
  Context --> Service[serviceNetworkArn]
  Context --> ServiceArn[serviceArn]
  Context --> Target[targetGroupArn]
  Context --> Metadata[region and timeEpoch]
  Context --> Identity[identity]
  Identity --> Caller[optional caller attributes]
```

## Usage

```ts
import type { LatticeRequestContextV2 } from './types';

function logLatticeRequest(context: LatticeRequestContextV2): void {
  console.log({
    serviceNetworkArn: context.serviceNetworkArn,
    serviceArn: context.serviceArn,
    targetGroupArn: context.targetGroupArn,
    region: context.region,
    principal: context.identity.principal,
    sourceVpcArn: context.identity.sourceVpcArn,
  });
}
```

## AI Coding Instructions

- Treat `identity` fields as optional and check for `undefined` before reading or forwarding them.
- Keep ARN fields as strings; do not parse them unless the calling code needs a specific ARN component.
- Use `timeEpoch` as the request timestamp value received from the Lattice event.
- Pass this context through adapter boundaries when handlers need Lattice service, target group, or caller identity metadata.
