Skip to main content
The LambdaResourceClient allows you to invoke AWS Lambda functions directly from your application code.

Usage

import { myLambdaClient } from "./clients";

const result = await myLambdaClient.invoke(
  "Invoke",
  {
    FunctionName: "my-function",
    Payload: JSON.stringify({ key: "value" }),
  },
  "call-lambda"
);

if (result.ok) {
  console.log(result.result.data);
}

Inputs

The invoke method accepts the following arguments:
command
string
required
The Lambda command to execute. Typically "Invoke".
params
Record<string, unknown>
required
The parameters for the command, matching the AWS SDK input shape (e.g., FunctionName, Payload).
invocationKey
string
required
A unique identifier for this operation.
timeoutMs
number
Optional timeout in milliseconds.

Outputs

On success (ok: true), the result object contains:
kind
"api"
Discriminator for the response type.
command
string
The command that was executed.
data
unknown
The response payload from the Lambda function.