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

main
ts 44 lines 1.64 KB
Raw
1 import type * as ga from "@distilled.cloud/aws/global-accelerator";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { EndpointGroup } from "./EndpointGroup.ts";
5
6 /**
7 * Runtime binding for `globalaccelerator:DescribeEndpointGroup`.
8 *
9 * Reads the bound {@link EndpointGroup}'s live state — most usefully the
10 * observed per-endpoint health (`HEALTHY` / `UNHEALTHY` / `INITIAL`) — so a
11 * function can monitor regional endpoint health or verify an endpoint it
12 * just registered. The endpoint group ARN is injected from the binding.
13 * Provide the implementation with
14 * `Effect.provide(AWS.GlobalAccelerator.DescribeEndpointGroupHttp)`.
15 * ### Observing Endpoint Groups
16 * **Example:** Check Endpoint Health
17 * ```typescript
18 * // init — bind the operation to the endpoint group
19 * const describeEndpointGroup =
20 * yield* AWS.GlobalAccelerator.DescribeEndpointGroup(group);
21 *
22 * // runtime
23 * const { EndpointGroup } = yield* describeEndpointGroup({});
24 * const unhealthy = (EndpointGroup?.EndpointDescriptions ?? []).filter(
25 * (endpoint) => endpoint.HealthState === "UNHEALTHY",
26 * );
27 * ```
28 *
29 * @binding
30 */
31 export interface DescribeEndpointGroup extends Binding.Service<
32 DescribeEndpointGroup,
33 "AWS.GlobalAccelerator.DescribeEndpointGroup",
34 (
35 endpointGroup: EndpointGroup,
36 ) => Effect.Effect<
37 (
38 request: Omit<ga.DescribeEndpointGroupRequest, "EndpointGroupArn">,
39 ) => Effect.Effect<ga.DescribeEndpointGroupResponse, ga.DescribeEndpointGroupError>
40 >
41 > {}
42 export const DescribeEndpointGroup = Binding.Service<DescribeEndpointGroup>(
43 "AWS.GlobalAccelerator.DescribeEndpointGroup",
44 );