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

main
ts 38 lines 1.27 KB
Raw
1 import type * as ECS from "@distilled.cloud/aws/ecs";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Cluster } from "./Cluster.ts";
5
6 export interface DescribeTasksRequest extends Omit<ECS.DescribeTasksRequest, "cluster"> {}
7
8 /**
9 * Runtime binding for `ecs:DescribeTasks`.
10 *
11 * Bind this operation to a `Cluster` inside a function runtime to get a
12 * callable that describes tasks in the bound cluster. The cluster ARN is
13 * injected automatically and the host is granted `ecs:DescribeTasks` on the
14 * cluster's tasks.
15 * ### Describing Tasks
16 * **Example:** Poll a Task Until It Stops
17 * ```typescript
18 * const describeTasks = yield* AWS.ECS.DescribeTasks(cluster);
19 *
20 * const response = yield* describeTasks({ tasks: [taskArn] });
21 * const status = response.tasks?.[0]?.lastStatus;
22 * const exitCode = response.tasks?.[0]?.containers?.[0]?.exitCode;
23 * ```
24 *
25 * @binding
26 */
27 export interface DescribeTasks extends Binding.Service<
28 DescribeTasks,
29 "AWS.ECS.DescribeTasks",
30 (
31 cluster: Cluster,
32 ) => Effect.Effect<
33 (
34 request: DescribeTasksRequest,
35 ) => Effect.Effect<ECS.DescribeTasksResponse, ECS.DescribeTasksError>
36 >
37 > {}
38 export const DescribeTasks = Binding.Service<DescribeTasks>("AWS.ECS.DescribeTasks");