1import * as route53domains from "@distilled.cloud/aws/route-53-domains";
2import * as Layer from "effect/Layer";
3import { makeRoute53DomainsHttpBinding } from "./BindingHttp.ts";
4import { RegisterDomain } from "./RegisterDomain.ts";
5
6export const RegisterDomainHttp = Layer.effect(
7 RegisterDomain,
8 makeRoute53DomainsHttpBinding({
9 capability: "RegisterDomain",
10 // RegisterDomain pre-validates that the caller can create the hosted
11 // zone Route 53 auto-creates during registration — without
12 // route53:CreateHostedZone the API rejects the call with
13 // AccessDeniedException ("not authorized to perform:
14 // route53:CreateHostedZone") before even validating the TLD.
15 iamActions: ["route53domains:RegisterDomain", "route53:CreateHostedZone"],
16 operation: route53domains.registerDomain,
17 }),
18);