1import type * as route53domains from "@distilled.cloud/aws/route-53-domains";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5export interface RegisterDomainRequest
6 extends route53domains.RegisterDomainRequest {}
7
8/**
9 * Runtime binding for `route53domains:RegisterDomain` — register a domain
10 * name with Route 53 programmatically. Registration is asynchronous: the
11 * response carries an `OperationId` you can poll with
12 * `AWS.Route53Domains.GetOperationDetail`.
13 *
14 * Registering a domain **bills the AWS account** for the registration fee,
15 * so guard calls carefully (e.g. behind a
16 * `AWS.Route53Domains.CheckDomainAvailability` check and explicit user
17 * consent in a domain-reseller flow).
18 *
19 * Route 53 Domains is a global registration API with no resource-level IAM:
20 * the binding takes no arguments and grants the function
21 * `route53domains:RegisterDomain` plus `route53:CreateHostedZone` (the API
22 * pre-validates that the caller can create the hosted zone Route 53
23 * auto-creates during registration) on `*`. Calls are pinned to
24 * `us-east-1`, the only region that serves the Route 53 Domains API,
25 * regardless of where the function runs.
26 *
27 * Provide the implementation with
28 * `Effect.provide(AWS.Route53Domains.RegisterDomainHttp)`.
29 *
30 * ### Registering Domains
31 * **Example:** Register a Domain for a Customer
32 * ```typescript
33 * // init
34 * const registerDomain = yield* AWS.Route53Domains.RegisterDomain();
35 *
36 * // runtime
37 * const result = yield* registerDomain({
38 * DomainName: "example-customer-domain.com",
39 * DurationInYears: 1,
40 * AdminContact: contact,
41 * RegistrantContact: contact,
42 * TechContact: contact,
43 * AutoRenew: true,
44 * });
45 * // poll result.OperationId with GetOperationDetail until SUCCESSFUL
46 * ```
47 *
48 * @binding
49 */
50export interface RegisterDomain extends Binding.Service<
51 RegisterDomain,
52 "AWS.Route53Domains.RegisterDomain",
53 () => Effect.Effect<
54 (
55 request: RegisterDomainRequest,
56 ) => Effect.Effect<
57 route53domains.RegisterDomainResponse,
58 route53domains.RegisterDomainError
59 >
60 >
61> {}
62export const RegisterDomain = Binding.Service<RegisterDomain>(
63 "AWS.Route53Domains.RegisterDomain",
64);