Skip to content

LatticeRequestContextV2

reference
1 min readUpdated

Kind: Interface

Source: src/adapter/aws-lambda/types.ts

Part of: 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

PropertyType
serviceNetworkArnstring
serviceArnstring
targetGroupArnstring
regionstring
timeEpochstring
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.

Was this page helpful?

Download as PDF
LatticeRequestContextV2 — Hono (narrator proof)