| 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 | * `TestDNSAnswer` request with `HostedZoneId` injected from the bound |
| 8 | * {@link HostedZone}. |
| 9 | */ |
| 10 | export interface TestDNSAnswerRequest extends Omit< |
| 11 | route53.TestDNSAnswerRequest, |
| 12 | "HostedZoneId" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for the `TestDNSAnswer` operation (IAM action |
| 17 | * `route53:TestDNSAnswer`; the action does not support resource-level |
| 18 | * permissions, so it is granted on `*`). |
| 19 | * |
| 20 | * Asks Route 53's authoritative servers what they would answer for a record |
| 21 | * in the bound {@link HostedZone} — works before (and without) delegation, |
| 22 | * so it verifies records written via |
| 23 | * {@link ChangeResourceRecordSets} without waiting for public DNS. Public |
| 24 | * zones only. Provide the implementation with |
| 25 | * `Effect.provide(AWS.Route53.TestDNSAnswerHttp)`. |
| 26 | * ### Inspecting Zones |
| 27 | * **Example:** Verify a record answers |
| 28 | * ```typescript |
| 29 | * const testDnsAnswer = yield* AWS.Route53.TestDNSAnswer(zone); |
| 30 | * |
| 31 | * const answer = yield* testDnsAnswer({ |
| 32 | * RecordName: "www.example.com", |
| 33 | * RecordType: "A", |
| 34 | * }); |
| 35 | * // answer.ResponseCode -> "NOERROR", answer.RecordData -> the values |
| 36 | * ``` |
| 37 | * |
| 38 | * @binding |
| 39 | */ |
| 40 | export interface TestDNSAnswer extends Binding.Service< |
| 41 | TestDNSAnswer, |
| 42 | "AWS.Route53.TestDNSAnswer", |
| 43 | ( |
| 44 | zone: HostedZone, |
| 45 | ) => Effect.Effect< |
| 46 | ( |
| 47 | request: TestDNSAnswerRequest, |
| 48 | ) => Effect.Effect< |
| 49 | route53.TestDNSAnswerResponse, |
| 50 | route53.TestDNSAnswerError |
| 51 | > |
| 52 | > |
| 53 | > {} |
| 54 | export const TestDNSAnswer = Binding.Service<TestDNSAnswer>( |
| 55 | "AWS.Route53.TestDNSAnswer", |
| 56 | ); |