1import type * as ECS from "@distilled.cloud/aws/ecs";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Cluster } from "./Cluster.ts";
5
6export interface ListContainerInstancesRequest extends Omit<
7 ECS.ListContainerInstancesRequest,
8 "cluster"
9> {}
10
11/**
12 * Runtime binding for `ecs:ListContainerInstances`.
13 *
14 * Bind this operation to a `Cluster` inside a function runtime to get a
15 * callable that lists container-instance ARNs registered to the bound
16 * cluster (EC2/EXTERNAL launch types). The cluster ARN is injected
17 * automatically and the host is granted `ecs:ListContainerInstances` on the
18 * cluster.
19 * ### Container Instances
20 * **Example:** List ACTIVE Container Instances
21 * ```typescript
22 * const listContainerInstances = yield* AWS.ECS.ListContainerInstances(cluster);
23 *
24 * const response = yield* listContainerInstances({ status: "ACTIVE" });
25 * const instanceArns = response.containerInstanceArns ?? [];
26 * ```
27 *
28 * @binding
29 */
30export interface ListContainerInstances extends Binding.Service<
31 ListContainerInstances,
32 "AWS.ECS.ListContainerInstances",
33 (
34 cluster: Cluster,
35 ) => Effect.Effect<
36 (
37 request: ListContainerInstancesRequest,
38 ) => Effect.Effect<
39 ECS.ListContainerInstancesResponse,
40 ECS.ListContainerInstancesError
41 >
42 >
43> {}
44export const ListContainerInstances = Binding.Service<ListContainerInstances>(
45 "AWS.ECS.ListContainerInstances",
46);