The best way to control Claude Code, Codex and more from any computer or phone

main
ts 48 lines 1.53 KB
Raw
1 import type * as ec2 from "@distilled.cloud/aws/ec2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Instance } from "./Instance.ts";
5
6 /**
7 * `StartInstances` request with `InstanceIds` injected from the bound
8 * {@link Instance}.
9 */
10 export interface StartInstanceRequest extends Omit<
11 ec2.StartInstancesRequest,
12 "InstanceId" | "InstanceIds"
13 > {}
14
15 /**
16 * Runtime binding for the `StartInstances` operation scoped to the bound
17 * {@link Instance} (IAM action `ec2:StartInstances` on the instance ARN).
18 *
19 * Starts the stopped instance — the classic scheduled Lambda that powers dev
20 * boxes on in the morning. Starting an already-running instance succeeds
21 * without effect. Provide the implementation with
22 * `Effect.provide(AWS.EC2.StartInstanceHttp)`.
23 * ### Instance Lifecycle Control
24 * **Example:** Start the bound instance
25 * ```typescript
26 * // init — bind the operation to the instance
27 * const startInstance = yield* AWS.EC2.StartInstance(instance);
28 *
29 * // runtime — power the instance on
30 * const result = yield* startInstance();
31 * console.log(result.StartingInstances?.[0]?.CurrentState?.Name);
32 * ```
33 *
34 * @binding
35 */
36 export interface StartInstance extends Binding.Service<
37 StartInstance,
38 "AWS.EC2.StartInstance",
39 (
40 instance: Instance,
41 ) => Effect.Effect<
42 (
43 request?: StartInstanceRequest,
44 ) => Effect.Effect<ec2.StartInstancesResult, ec2.StartInstancesError>
45 >
46 > {}
47
48 export const StartInstance = Binding.Service<StartInstance>("AWS.EC2.StartInstance");