@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 50 lines 1.79 KB
Raw
1 import type * as autoscaling from "@distilled.cloud/aws/auto-scaling";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { AutoScalingGroup } from "./AutoScalingGroup.ts";
5
6 /**
7 * `SetInstanceHealth` request. The operation is instance-scoped — EC2 Auto
8 * Scaling resolves the instance's owning group for authorization, which the
9 * binding grants on the bound {@link AutoScalingGroup}'s ARN.
10 */
11 export interface SetInstanceHealthRequest extends autoscaling.SetInstanceHealthQuery {}
12
13 /**
14 * Runtime binding for the `SetInstanceHealth` operation (IAM action
15 * `autoscaling:SetInstanceHealth` scoped to the group ARN).
16 *
17 * Reports an instance's health to EC2 Auto Scaling — the backbone of custom
18 * health checks: a watchdog Lambda (or the instance itself) flags an instance
19 * `Unhealthy` and the group replaces it. Provide the implementation with
20 * `Effect.provide(AWS.AutoScaling.SetInstanceHealthHttp)`.
21 * ### Custom Health Checks
22 * **Example:** Flag a failing instance for replacement
23 * ```typescript
24 * // init — bind the operation to the group
25 * const setInstanceHealth = yield* AWS.AutoScaling.SetInstanceHealth(group);
26 *
27 * // runtime — mark the instance unhealthy so the group replaces it
28 * yield* setInstanceHealth({
29 * InstanceId: instanceId,
30 * HealthStatus: "Unhealthy",
31 * });
32 * ```
33 *
34 * @binding
35 */
36 export interface SetInstanceHealth extends Binding.Service<
37 SetInstanceHealth,
38 "AWS.AutoScaling.SetInstanceHealth",
39 (
40 group: AutoScalingGroup,
41 ) => Effect.Effect<
42 (
43 request: SetInstanceHealthRequest,
44 ) => Effect.Effect<autoscaling.SetInstanceHealthResponse, autoscaling.SetInstanceHealthError>
45 >
46 > {}
47
48 export const SetInstanceHealth = Binding.Service<SetInstanceHealth>(
49 "AWS.AutoScaling.SetInstanceHealth",
50 );