| 1 | import type * as microvms from "@distilled.cloud/aws/lambda-microvms"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { MicrovmImage } from "./MicrovmImage.ts"; |
| 5 | |
| 6 | export interface GetMicrovmRequest extends microvms.GetMicrovmRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `GetMicrovm`. |
| 10 | * |
| 11 | * Bind it to a {@link MicrovmImage} to get a callable that reads the state, |
| 12 | * endpoint, and configuration of a running MicroVM by `microvmIdentifier`. |
| 13 | * ### Inspecting MicroVMs |
| 14 | * **Example:** Get a MicroVM |
| 15 | * ```typescript |
| 16 | * const getMicrovm = yield* AWS.Lambda.GetMicrovm(Sandbox); |
| 17 | * const vm = yield* getMicrovm({ microvmIdentifier: id }); |
| 18 | * ``` |
| 19 | * |
| 20 | * @binding |
| 21 | */ |
| 22 | export interface GetMicrovm extends Binding.Service< |
| 23 | GetMicrovm, |
| 24 | "AWS.Lambda.GetMicrovm", |
| 25 | ( |
| 26 | image: MicrovmImage, |
| 27 | ) => Effect.Effect< |
| 28 | ( |
| 29 | request: GetMicrovmRequest, |
| 30 | ) => Effect.Effect<microvms.GetMicrovmResponse, microvms.GetMicrovmError> |
| 31 | > |
| 32 | > {} |
| 33 | export const GetMicrovm = Binding.Service<GetMicrovm>("AWS.Lambda.GetMicrovm"); |