@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, 06:00 UTC

main
ts 54 lines 1.83 KB
Raw
1 import type * as elbv2 from "@distilled.cloud/aws/elastic-load-balancing-v2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { TargetGroup } from "./TargetGroup.ts";
5
6 /**
7 * `DescribeTargetHealth` request with `TargetGroupArn` injected from the
8 * bound {@link TargetGroup}.
9 */
10 export interface DescribeTargetHealthRequest extends Omit<
11 elbv2.DescribeTargetHealthInput,
12 "TargetGroupArn"
13 > {}
14
15 /**
16 * Runtime binding for the `DescribeTargetHealth` operation (IAM action
17 * `elasticloadbalancing:DescribeTargetHealth`; ELBv2 `Describe*` actions do
18 * not support resource-level permissions, so the grant is on `*`).
19 *
20 * Reads the live health state of the bound target group's targets — e.g. a
21 * readiness gate that waits for a freshly registered target to turn
22 * `healthy` before shifting traffic, or an ops endpoint surfacing fleet
23 * health. Provide the implementation with
24 * `Effect.provide(AWS.ELBv2.DescribeTargetHealthHttp)`.
25 * ### Target Health
26 * **Example:** Check the health of every target
27 * ```typescript
28 * // init — bind the operation to the target group
29 * const describeTargetHealth = yield* AWS.ELBv2.DescribeTargetHealth(targetGroup);
30 *
31 * // runtime — read health states
32 * const health = yield* describeTargetHealth({});
33 * const states = health.TargetHealthDescriptions?.map(
34 * (d) => d.TargetHealth?.State,
35 * );
36 * ```
37 *
38 * @binding
39 */
40 export interface DescribeTargetHealth extends Binding.Service<
41 DescribeTargetHealth,
42 "AWS.ELBv2.DescribeTargetHealth",
43 (
44 targetGroup: TargetGroup,
45 ) => Effect.Effect<
46 (
47 request: DescribeTargetHealthRequest,
48 ) => Effect.Effect<elbv2.DescribeTargetHealthOutput, elbv2.DescribeTargetHealthError>
49 >
50 > {}
51
52 export const DescribeTargetHealth = Binding.Service<DescribeTargetHealth>(
53 "AWS.ELBv2.DescribeTargetHealth",
54 );