@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 36 lines 1.26 KB
Raw
1 import type * as memorydb from "@distilled.cloud/aws/memorydb";
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 * Runtime binding for the `FailoverShard` operation (IAM action
8 * `memorydb:FailoverShard`), scoped to one {@link Cluster}.
9 *
10 * Fails over a shard's primary node to a replica — designed for testing how
11 * your application behaves during a MemoryDB failover (chaos testing), not
12 * as a production remediation tool. Provide the implementation with
13 * `Effect.provide(AWS.MemoryDB.FailoverShardHttp)`.
14 * ### Testing Failover
15 * **Example:** Fail Over a Shard
16 * ```typescript
17 * const failoverShard = yield* MemoryDB.FailoverShard(cluster);
18 *
19 * const result = yield* failoverShard({ ShardName: "0001" });
20 * // result.Cluster.Status → "updating"
21 * ```
22 *
23 * @binding
24 */
25 export interface FailoverShard extends Binding.Service<
26 FailoverShard,
27 "AWS.MemoryDB.FailoverShard",
28 (
29 cluster: Cluster,
30 ) => Effect.Effect<
31 (
32 request: Omit<memorydb.FailoverShardRequest, "ClusterName">,
33 ) => Effect.Effect<memorydb.FailoverShardResponse, memorydb.FailoverShardError>
34 >
35 > {}
36 export const FailoverShard = Binding.Service<FailoverShard>("AWS.MemoryDB.FailoverShard");