@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 36 lines 1.36 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 * Runtime binding for the `DescribeInstances` operation scoped to the bound
8 * {@link Instance} (IAM action `ec2:DescribeInstances`; `Describe*` actions
9 * do not support resource-level permissions, so the grant is on `*`).
10 *
11 * Returns the bound instance's live description — state, addresses, block
12 * device mappings — e.g. a Lambda that reports whether a dev box is running.
13 * Provide the implementation with
14 * `Effect.provide(AWS.EC2.DescribeInstanceHttp)`.
15 * ### Observing Instances
16 * **Example:** Read the bound instance's live state
17 * ```typescript
18 * // init — bind the operation to the instance
19 * const describeInstance = yield* AWS.EC2.DescribeInstance(instance);
20 *
21 * // runtime — read the live description
22 * const live = yield* describeInstance();
23 * console.log(live?.State?.Name, live?.PrivateIpAddress);
24 * ```
25 *
26 * @binding
27 */
28 export interface DescribeInstance extends Binding.Service<
29 DescribeInstance,
30 "AWS.EC2.DescribeInstance",
31 (
32 instance: Instance,
33 ) => Effect.Effect<() => Effect.Effect<ec2.Instance | undefined, ec2.DescribeInstancesError>>
34 > {}
35
36 export const DescribeInstance = Binding.Service<DescribeInstance>("AWS.EC2.DescribeInstance");