1import type * as rds from "@distilled.cloud/aws/rds";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import 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} — promotes a reader to
11 * writer, e.g. for chaos testing or AZ evacuation. The cluster identifier
12 * is injected from the binding. Provide the implementation with
13 * `Effect.provide(AWS.RDS.FailoverDBClusterHttp)`.
14 * ### Operating a Cluster
15 * **Example:** Force a Failover
16 * ```typescript
17 * // init — bind the operation to the cluster
18 * const failoverDBCluster = yield* AWS.RDS.FailoverDBCluster(cluster);
19 *
20 * // runtime
21 * yield* failoverDBCluster();
22 * ```
23 *
24 * @binding
25 */
26export interface FailoverDBCluster extends Binding.Service<
27 FailoverDBCluster,
28 "AWS.RDS.FailoverDBCluster",
29 (
30 cluster: DBCluster,
31 ) => Effect.Effect<
32 (
33 request?: Omit<rds.FailoverDBClusterMessage, "DBClusterIdentifier">,
34 ) => Effect.Effect<rds.FailoverDBClusterResult, rds.FailoverDBClusterError>
35 >
36> {}
37export const FailoverDBCluster = Binding.Service<FailoverDBCluster>(
38 "AWS.RDS.FailoverDBCluster",
39);