| 1 | import type * as ga from "@distilled.cloud/aws/global-accelerator"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Accelerator } from "./Accelerator.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `globalaccelerator:DescribeAccelerator`. |
| 8 | * |
| 9 | * Reads the bound {@link Accelerator}'s live state — deployment status |
| 10 | * (`DEPLOYED` / `IN_PROGRESS`), DNS names, static IP sets, and whether it is |
| 11 | * enabled — so a function can health-check the accelerator or hand out its |
| 12 | * DNS name at runtime. The accelerator ARN is injected from the binding. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.GlobalAccelerator.DescribeAcceleratorHttp)`. |
| 15 | * ### Observing Accelerators |
| 16 | * **Example:** Read the Accelerator's Status and DNS Name |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the accelerator |
| 19 | * const describeAccelerator = |
| 20 | * yield* AWS.GlobalAccelerator.DescribeAccelerator(accelerator); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const { Accelerator } = yield* describeAccelerator(); |
| 24 | * yield* Effect.log(`${Accelerator?.DnsName} is ${Accelerator?.Status}`); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface DescribeAccelerator extends Binding.Service< |
| 30 | DescribeAccelerator, |
| 31 | "AWS.GlobalAccelerator.DescribeAccelerator", |
| 32 | ( |
| 33 | accelerator: Accelerator, |
| 34 | ) => Effect.Effect< |
| 35 | () => Effect.Effect< |
| 36 | ga.DescribeAcceleratorResponse, |
| 37 | ga.DescribeAcceleratorError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const DescribeAccelerator = Binding.Service<DescribeAccelerator>( |
| 42 | "AWS.GlobalAccelerator.DescribeAccelerator", |
| 43 | ); |