npm install --save @effect-aws/client-lambda
With default LambdaClient instance:
import { Lambda } from "@effect-aws/client-lambda";
const program = Lambda.invoke(args);
const result = pipe(
program,
Effect.provide(Lambda.defaultLayer),
Effect.runPromise,
);
With custom LambdaClient instance:
import { Lambda } from "@effect-aws/client-lambda";
const program = Lambda.invoke(args);
const result = await pipe(
program,
Effect.provide(
Lambda.baseLayer(() => new LambdaClient({ region: "eu-central-1" })),
),
Effect.runPromise,
);
With custom LambdaClient configuration:
import { Lambda } from "@effect-aws/client-lambda";
const program = Lambda.invoke(args);
const result = await pipe(
program,
Effect.provide(Lambda.layer({ region: "eu-central-1" })),
Effect.runPromiseExit,
);
or use Lambda.baseLayer((default) => new LambdaClient({ ...default, region: "eu-central-1" }))