| 1 | import type * as route53domains from "@distilled.cloud/aws/route-53-domains"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface UpdateDomainNameserversRequest |
| 6 | extends route53domains.UpdateDomainNameserversRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `route53domains:UpdateDomainNameservers` — replace |
| 10 | * the nameservers for a domain registered in the current AWS account (e.g. |
| 11 | * point a registered domain at the delegation set of a Route 53 hosted |
| 12 | * zone). The update is asynchronous: the response carries an `OperationId` |
| 13 | * you can poll with `AWS.Route53Domains.GetOperationDetail`. |
| 14 | * |
| 15 | * Updating nameservers for a domain that is not registered in the account |
| 16 | * fails with a typed `DomainNotFound` error. |
| 17 | * |
| 18 | * Route 53 Domains is a global registration API with no resource-level IAM: |
| 19 | * the binding takes no arguments and grants the function |
| 20 | * `route53domains:UpdateDomainNameservers` on `*`. Calls are pinned to |
| 21 | * `us-east-1`, the only region that serves the Route 53 Domains API, |
| 22 | * regardless of where the function runs. |
| 23 | * |
| 24 | * Provide the implementation with |
| 25 | * `Effect.provide(AWS.Route53Domains.UpdateDomainNameserversHttp)`. |
| 26 | * |
| 27 | * ### Updating Nameservers |
| 28 | * **Example:** Point a Domain at a Hosted Zone's Delegation Set |
| 29 | * ```typescript |
| 30 | * // init |
| 31 | * const updateDomainNameservers = |
| 32 | * yield* AWS.Route53Domains.UpdateDomainNameservers(); |
| 33 | * |
| 34 | * // runtime |
| 35 | * const result = yield* updateDomainNameservers({ |
| 36 | * DomainName: "example.com", |
| 37 | * Nameservers: [ |
| 38 | * { Name: "ns-1.awsdns-01.org" }, |
| 39 | * { Name: "ns-2.awsdns-02.com" }, |
| 40 | * ], |
| 41 | * }); |
| 42 | * // poll result.OperationId with GetOperationDetail until SUCCESSFUL |
| 43 | * ``` |
| 44 | * |
| 45 | * @binding |
| 46 | */ |
| 47 | export interface UpdateDomainNameservers extends Binding.Service< |
| 48 | UpdateDomainNameservers, |
| 49 | "AWS.Route53Domains.UpdateDomainNameservers", |
| 50 | () => Effect.Effect< |
| 51 | ( |
| 52 | request: UpdateDomainNameserversRequest, |
| 53 | ) => Effect.Effect< |
| 54 | route53domains.UpdateDomainNameserversResponse, |
| 55 | route53domains.UpdateDomainNameserversError |
| 56 | > |
| 57 | > |
| 58 | > {} |
| 59 | export const UpdateDomainNameservers = Binding.Service<UpdateDomainNameservers>( |
| 60 | "AWS.Route53Domains.UpdateDomainNameservers", |
| 61 | ); |