1import type * as apprunner from "@distilled.cloud/aws/apprunner";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Service } from "./Service.ts";
5
6export interface DescribeCustomDomainsRequest extends Omit<
7 apprunner.DescribeCustomDomainsRequest,
8 "ServiceArn"
9> {}
10
11/**
12 * Describe the custom domains associated with an App Runner
13 * {@link Service} from a Lambda (or other AWS runtime) — poll a domain's
14 * certificate validation status (`PENDING_VALIDATION` -> `SUCCESS`) after
15 * {@link AssociateCustomDomain}, and read the `DNSTarget` customers point
16 * their DNS at.
17 *
18 * Provide `AppRunner.DescribeCustomDomainsHttp` on the hosting function's
19 * Effect to implement the binding.
20 *
21 * ### Custom Domains
22 * **Example:** Check a domain's validation status
23 * ```typescript
24 * const describeCustomDomains = yield* AppRunner.DescribeCustomDomains(service);
25 * const { CustomDomains, DNSTarget } = yield* describeCustomDomains();
26 * const domain = CustomDomains.find((d) => d.DomainName === "app.customer.com");
27 * // domain?.Status -> "pending_certificate_dns_validation" | "active" | ...
28 * ```
29 *
30 * @binding
31 */
32export interface DescribeCustomDomains extends Binding.Service<
33 DescribeCustomDomains,
34 "AWS.AppRunner.DescribeCustomDomains",
35 (
36 service: Service,
37 ) => Effect.Effect<
38 (
39 request?: DescribeCustomDomainsRequest,
40 ) => Effect.Effect<
41 apprunner.DescribeCustomDomainsResponse,
42 apprunner.DescribeCustomDomainsError
43 >
44 >
45> {}
46export const DescribeCustomDomains = Binding.Service<DescribeCustomDomains>(
47 "AWS.AppRunner.DescribeCustomDomains",
48);