Kind: Interface
Source: src/adapter/aws-lambda/types.ts
Part of: 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
mermaidgraph LR Request[ALB Request] --> Context[ALBRequestContext] Context --> ELB[elb] ELB --> TargetGroupArn[targetGroupArn: string]
Usage
tsimport 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
elbobject present when constructing anALBRequestContext. - Treat
targetGroupArnas 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.
Was this page helpful?