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

main
ts 37 lines 1.33 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 GetTaskProtectionRequest extends Omit<ECS.GetTaskProtectionRequest, "cluster"> {}
7
8 /**
9 * Runtime binding for `ecs:GetTaskProtection`.
10 *
11 * Bind this operation to a `Cluster` inside a function runtime to get a
12 * callable that reads the scale-in protection status of service-managed tasks
13 * in the bound cluster. The cluster ARN is injected automatically and the
14 * host is granted `ecs:GetTaskProtection` on the cluster's tasks.
15 * ### Task Protection
16 * **Example:** Read a Task's Protection Status
17 * ```typescript
18 * const getTaskProtection = yield* AWS.ECS.GetTaskProtection(cluster);
19 *
20 * const response = yield* getTaskProtection({ tasks: [taskArn] });
21 * const protected_ = response.protectedTasks?.[0]?.protectionEnabled;
22 * ```
23 *
24 * @binding
25 */
26 export interface GetTaskProtection extends Binding.Service<
27 GetTaskProtection,
28 "AWS.ECS.GetTaskProtection",
29 (
30 cluster: Cluster,
31 ) => Effect.Effect<
32 (
33 request: GetTaskProtectionRequest,
34 ) => Effect.Effect<ECS.GetTaskProtectionResponse, ECS.GetTaskProtectionError>
35 >
36 > {}
37 export const GetTaskProtection = Binding.Service<GetTaskProtection>("AWS.ECS.GetTaskProtection");