| 1 | import type * as dax from "@distilled.cloud/aws/dax"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Cluster } from "./Cluster.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `IncreaseReplicationFactor` operation (IAM action |
| 8 | * `dax:IncreaseReplicationFactor`), scoped to one {@link Cluster}. |
| 9 | * |
| 10 | * Adds read-replica nodes to the bound DAX cluster — the building block of |
| 11 | * scale-out automation (e.g. a Lambda reacting to a CloudWatch alarm on |
| 12 | * cluster CPU or cache-miss rate). Provide the implementation with |
| 13 | * `Effect.provide(AWS.DAX.IncreaseReplicationFactorHttp)`. |
| 14 | * ### Scaling a Cluster |
| 15 | * **Example:** Scale Out to Three Nodes |
| 16 | * ```typescript |
| 17 | * const increaseReplicationFactor = |
| 18 | * yield* DAX.IncreaseReplicationFactor(cluster); |
| 19 | * |
| 20 | * const result = yield* increaseReplicationFactor({ |
| 21 | * NewReplicationFactor: 3, |
| 22 | * }); |
| 23 | * // result.Cluster?.TotalNodes → 3 (new nodes provision asynchronously) |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface IncreaseReplicationFactor extends Binding.Service< |
| 29 | IncreaseReplicationFactor, |
| 30 | "AWS.DAX.IncreaseReplicationFactor", |
| 31 | ( |
| 32 | cluster: Cluster, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request: Omit<dax.IncreaseReplicationFactorRequest, "ClusterName">, |
| 36 | ) => Effect.Effect< |
| 37 | dax.IncreaseReplicationFactorResponse, |
| 38 | dax.IncreaseReplicationFactorError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const IncreaseReplicationFactor = |
| 43 | Binding.Service<IncreaseReplicationFactor>( |
| 44 | "AWS.DAX.IncreaseReplicationFactor", |
| 45 | ); |