| 1 | import type * as cloudhsm from "@distilled.cloud/aws/cloudhsm-v2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for the `DescribeClusters` operation (IAM action |
| 7 | * `cloudhsm:DescribeClusters`). |
| 8 | * |
| 9 | * Lists the account's CloudHSM clusters (optionally filtered by cluster id, |
| 10 | * VPC or state) with each cluster's HSMs embedded — the building block of |
| 11 | * cluster-health monitoring and automatic-HSM-replacement automation. |
| 12 | * Provide the implementation with |
| 13 | * `Effect.provide(AWS.CloudHSMV2.DescribeClustersHttp)`. |
| 14 | * ### Monitoring Clusters |
| 15 | * **Example:** Check A Cluster's HSM Health |
| 16 | * ```typescript |
| 17 | * const describeClusters = yield* AWS.CloudHSMV2.DescribeClusters(); |
| 18 | * |
| 19 | * const page = yield* describeClusters({ |
| 20 | * Filters: { clusterIds: [clusterId] }, |
| 21 | * }); |
| 22 | * const active = page.Clusters?.[0]?.Hsms?.filter( |
| 23 | * (hsm) => hsm.State === "ACTIVE", |
| 24 | * ); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface DescribeClusters extends Binding.Service< |
| 30 | DescribeClusters, |
| 31 | "AWS.CloudHSMV2.DescribeClusters", |
| 32 | () => Effect.Effect< |
| 33 | ( |
| 34 | request?: cloudhsm.DescribeClustersRequest, |
| 35 | ) => Effect.Effect< |
| 36 | cloudhsm.DescribeClustersResponse, |
| 37 | cloudhsm.DescribeClustersError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const DescribeClusters = Binding.Service<DescribeClusters>( |
| 42 | "AWS.CloudHSMV2.DescribeClusters", |
| 43 | ); |