skip to Main Content

What is the exact event type from the @types/aws-lambda package for a Lambda function hosted using function URL?

2

Answers


  1. In .NET, following request and response objects are used when using Lambda with Function URLs.

    You can find similar in typescript.

    Probably APIGatewayEventRequestContextV2 should be the respective one. Anyway, you can explore all the available types here at api-gateway-proxy.d.ts.

    Login or Signup to reply.
  2. The Lambda Function URL request and response events use the Amazon API Gateway payload format version 2.0.

    The corresponding TypeScript types are APIGatewayProxyEventV2 (request) and APIGatewayProxyResultV2<T> (response) in the @types/aws-lambda package.

    /**
     * Works with HTTP API integration Payload Format version 2.0
     * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
     */
    export type APIGatewayProxyHandlerV2<T = never> = Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2<T>>;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search