1import type * as Lambda from "@distilled.cloud/aws/lambda";
2import * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Function } from "./Function.ts";
5
6export interface GetFunctionRequest extends Omit<
7 Lambda.GetFunctionRequest,
8 "FunctionName"
9> {}
10
11/**
12 * Runtime binding for `lambda:GetFunction`.
13 *
14 * Reads the bound {@link Function}'s configuration, code location, and tags —
15 * useful for introspection and operational tooling at runtime. Provide the
16 * `GetFunctionHttp` layer on the Function to satisfy the binding.
17 * ### Function Metadata
18 * **Example:** Read a function's configuration
19 * ```typescript
20 * const getFunction = yield* AWS.Lambda.GetFunction(target);
21 *
22 * const response = yield* getFunction();
23 * const memory = response.Configuration?.MemorySize;
24 * ```
25 *
26 * @binding
27 */
28export interface GetFunction extends Binding.Service<
29 GetFunction,
30 "AWS.Lambda.GetFunction",
31 (
32 func: Function,
33 ) => Effect.Effect<
34 (
35 request?: GetFunctionRequest,
36 ) => Effect.Effect<Lambda.GetFunctionResponse, Lambda.GetFunctionError>
37 >
38> {}
39export const GetFunction = Binding.Service<GetFunction>(
40 "AWS.Lambda.GetFunction",
41);