| 1 | import type * as route53 from "@distilled.cloud/aws/route-53"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { HostedZone } from "./HostedZone.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `GetHostedZone` operation (IAM action |
| 8 | * `route53:GetHostedZone` on the hosted zone ARN). |
| 9 | * |
| 10 | * Reads the bound {@link HostedZone}'s detail — the authoritative name |
| 11 | * servers (delegation set), record count, and associated VPCs. Useful for |
| 12 | * compute that hands out NS records or verifies delegation at runtime. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.Route53.GetHostedZoneHttp)`. |
| 15 | * ### Inspecting Zones |
| 16 | * **Example:** Read the zone's name servers |
| 17 | * ```typescript |
| 18 | * const getHostedZone = yield* AWS.Route53.GetHostedZone(zone); |
| 19 | * |
| 20 | * const { DelegationSet } = yield* getHostedZone(); |
| 21 | * yield* Effect.log(DelegationSet?.NameServers); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface GetHostedZone extends Binding.Service< |
| 27 | GetHostedZone, |
| 28 | "AWS.Route53.GetHostedZone", |
| 29 | ( |
| 30 | zone: HostedZone, |
| 31 | ) => Effect.Effect< |
| 32 | () => Effect.Effect< |
| 33 | route53.GetHostedZoneResponse, |
| 34 | route53.GetHostedZoneError |
| 35 | > |
| 36 | > |
| 37 | > {} |
| 38 | export const GetHostedZone = Binding.Service<GetHostedZone>( |
| 39 | "AWS.Route53.GetHostedZone", |
| 40 | ); |