| 1 | import type * as eks from "@distilled.cloud/aws/eks"; |
| 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 `eks:DescribeUpdate`. |
| 8 | * |
| 9 | * Reads one update's status and parameters — poll it to track an in-flight version upgrade or config change. |
| 10 | * The cluster `name` is injected from the bound {@link Cluster} and `eks:DescribeUpdate` is granted on the cluster's ARN and sub-resource ARNs. |
| 11 | * Provide the implementation with |
| 12 | * `Effect.provide(AWS.EKS.DescribeUpdateHttp)`. |
| 13 | * ### Tracking Updates |
| 14 | * **Example:** Poll an Update's Status |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const describeUpdate = yield* AWS.EKS.DescribeUpdate(cluster); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { update } = yield* describeUpdate({ updateId }); |
| 21 | * const done = update?.status === "Successful"; |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface DescribeUpdate extends Binding.Service< |
| 27 | DescribeUpdate, |
| 28 | "AWS.EKS.DescribeUpdate", |
| 29 | ( |
| 30 | cluster: Cluster, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request: Omit<eks.DescribeUpdateRequest, "name">, |
| 34 | ) => Effect.Effect<eks.DescribeUpdateResponse, eks.DescribeUpdateError> |
| 35 | > |
| 36 | > {} |
| 37 | export const DescribeUpdate = Binding.Service<DescribeUpdate>( |
| 38 | "AWS.EKS.DescribeUpdate", |
| 39 | ); |