| 1 | import type * as neptune from "@distilled.cloud/aws/neptune"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 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 read |
| 11 | * replicas is promoted to primary — for resilience testing or to move the |
| 12 | * writer to a specific instance. The cluster identifier is injected from the |
| 13 | * binding. Provide the implementation with |
| 14 | * `Effect.provide(AWS.Neptune.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.Neptune.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.Neptune.FailoverDBCluster", |
| 32 | ( |
| 33 | cluster: DBCluster, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: Omit<neptune.FailoverDBClusterMessage, "DBClusterIdentifier">, |
| 37 | ) => Effect.Effect< |
| 38 | neptune.FailoverDBClusterResult, |
| 39 | neptune.FailoverDBClusterError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const FailoverDBCluster = Binding.Service<FailoverDBCluster>( |
| 44 | "AWS.Neptune.FailoverDBCluster", |
| 45 | ); |