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

main
ts 45 lines 1.53 KB
Raw
1 import type * as dsql from "@distilled.cloud/aws/dsql";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Cluster } from "./Cluster.ts";
5
6 /**
7 * Retrieves the VPC endpoint service name of an Aurora DSQL cluster — the
8 * `com.amazonaws.{region}.dsql-{suffix}` PrivateLink service name used to
9 * create a VPC interface endpoint that reaches the cluster privately.
10 *
11 * Bind a {@link Cluster} inside a function runtime to look the name up on
12 * demand (e.g. from an operations function that provisions VPC endpoints).
13 * Provide `DSQL.GetVpcEndpointServiceNameHttp` on the Function effect to
14 * implement the binding.
15 *
16 * ### Resolving the VPC Endpoint Service Name
17 * **Example:** Look Up the PrivateLink Service Name
18 * ```typescript
19 * // init
20 * const getVpcEndpointServiceName =
21 * yield* DSQL.GetVpcEndpointServiceName(cluster);
22 *
23 * return {
24 * fetch: Effect.gen(function* () {
25 * // runtime
26 * const { serviceName } = yield* getVpcEndpointServiceName();
27 * return HttpServerResponse.json({ serviceName });
28 * }),
29 * };
30 * ```
31 *
32 * @binding
33 */
34 export interface GetVpcEndpointServiceName extends Binding.Service<
35 GetVpcEndpointServiceName,
36 "AWS.DSQL.GetVpcEndpointServiceName",
37 <R extends Cluster>(
38 cluster: R,
39 ) => Effect.Effect<
40 () => Effect.Effect<dsql.GetVpcEndpointServiceNameOutput, dsql.GetVpcEndpointServiceNameError>
41 >
42 > {}
43 export const GetVpcEndpointServiceName = Binding.Service<GetVpcEndpointServiceName>(
44 "AWS.DSQL.GetVpcEndpointServiceName",
45 );