@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 41 lines 1.42 KB
Raw
1 import type * as dax from "@distilled.cloud/aws/dax";
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 `DecreaseReplicationFactor` operation (IAM action
8 * `dax:DecreaseReplicationFactor`), scoped to one {@link Cluster}.
9 *
10 * Removes read-replica nodes from the bound DAX cluster — the scale-in half
11 * of node-count automation (e.g. shrinking a cluster off-peak to cut
12 * node-hour cost). Provide the implementation with
13 * `Effect.provide(AWS.DAX.DecreaseReplicationFactorHttp)`.
14 * ### Scaling a Cluster
15 * **Example:** Scale In to One Node
16 * ```typescript
17 * const decreaseReplicationFactor =
18 * yield* DAX.DecreaseReplicationFactor(cluster);
19 *
20 * const result = yield* decreaseReplicationFactor({
21 * NewReplicationFactor: 1,
22 * });
23 * // result.Cluster?.TotalNodes → 1 once the removal completes
24 * ```
25 *
26 * @binding
27 */
28 export interface DecreaseReplicationFactor extends Binding.Service<
29 DecreaseReplicationFactor,
30 "AWS.DAX.DecreaseReplicationFactor",
31 (
32 cluster: Cluster,
33 ) => Effect.Effect<
34 (
35 request: Omit<dax.DecreaseReplicationFactorRequest, "ClusterName">,
36 ) => Effect.Effect<dax.DecreaseReplicationFactorResponse, dax.DecreaseReplicationFactorError>
37 >
38 > {}
39 export const DecreaseReplicationFactor = Binding.Service<DecreaseReplicationFactor>(
40 "AWS.DAX.DecreaseReplicationFactor",
41 );