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

main
ts 40 lines 1.38 KB
Raw
1 import type * as docdb from "@distilled.cloud/aws/docdb";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { DBCluster } from "./DBCluster.ts";
5
6 /**
7 * Runtime binding for the `FailoverDBCluster` operation (IAM action
8 * `rds:FailoverDBCluster`).
9 *
10 * Forces a failover of the bound {@link DBCluster} — one of the replicas is
11 * promoted to primary — for resilience testing or to move the writer to a
12 * specific instance. The cluster identifier is injected from the binding.
13 * Provide the implementation with
14 * `Effect.provide(AWS.DocDB.FailoverDBClusterHttp)`.
15 * ### Operating a Cluster
16 * **Example:** Force a Failover
17 * ```typescript
18 * // init — bind the operation to the cluster
19 * const failoverDBCluster = yield* AWS.DocDB.FailoverDBCluster(cluster);
20 *
21 * // runtime — promote a specific replica
22 * yield* failoverDBCluster({
23 * TargetDBInstanceIdentifier: replicaId,
24 * });
25 * ```
26 *
27 * @binding
28 */
29 export interface FailoverDBCluster extends Binding.Service<
30 FailoverDBCluster,
31 "AWS.DocDB.FailoverDBCluster",
32 (
33 cluster: DBCluster,
34 ) => Effect.Effect<
35 (
36 request?: Omit<docdb.FailoverDBClusterMessage, "DBClusterIdentifier">,
37 ) => Effect.Effect<docdb.FailoverDBClusterResult, docdb.FailoverDBClusterError>
38 >
39 > {}
40 export const FailoverDBCluster = Binding.Service<FailoverDBCluster>("AWS.DocDB.FailoverDBCluster");