| 1 | import type * as docdbelastic from "@distilled.cloud/aws/docdb-elastic"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for the `RestoreClusterFromSnapshot` operation (IAM |
| 7 | * actions `docdb-elastic:RestoreClusterFromSnapshot` + |
| 8 | * `docdb-elastic:TagResource`, plus the EC2 VPC-endpoint permissions elastic |
| 9 | * clusters need to attach to a VPC). |
| 10 | * |
| 11 | * Restores a new elastic cluster from a snapshot — e.g. a disaster-recovery |
| 12 | * Lambda that rebuilds a cluster from the latest nightly backup. Provide the |
| 13 | * implementation with |
| 14 | * `Effect.provide(AWS.DocDBElastic.RestoreClusterFromSnapshotHttp)`. |
| 15 | * ### Managing Snapshots |
| 16 | * **Example:** Restore a Cluster from a Snapshot |
| 17 | * ```typescript |
| 18 | * const restoreCluster = yield* DocDBElastic.RestoreClusterFromSnapshot(); |
| 19 | * |
| 20 | * const result = yield* restoreCluster({ |
| 21 | * snapshotArn, |
| 22 | * clusterName: "documents-restored", |
| 23 | * }); |
| 24 | * // result.cluster.status → "CREATING" |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface RestoreClusterFromSnapshot extends Binding.Service< |
| 30 | RestoreClusterFromSnapshot, |
| 31 | "AWS.DocDBElastic.RestoreClusterFromSnapshot", |
| 32 | () => Effect.Effect< |
| 33 | ( |
| 34 | request: docdbelastic.RestoreClusterFromSnapshotInput, |
| 35 | ) => Effect.Effect< |
| 36 | docdbelastic.RestoreClusterFromSnapshotOutput, |
| 37 | docdbelastic.RestoreClusterFromSnapshotError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const RestoreClusterFromSnapshot = |
| 42 | Binding.Service<RestoreClusterFromSnapshot>( |
| 43 | "AWS.DocDBElastic.RestoreClusterFromSnapshot", |
| 44 | ); |