import * as certificateManager from "aws-cdk-lib/aws-certificatemanager"; import * as cloudfront from "aws-cdk-lib/aws-cloudfront"; import type * as elbv2 from "aws-cdk-lib/aws-elasticloadbalancingv2"; import * as route53 from "aws-cdk-lib/aws-route53"; import { Construct, type IConstruct } from "constructs"; export type RedirectDomain = { /** Root domain to provision a hosted zone for, e.g. 'example.net'. */ domainName: string; /** Also redirect the www subdomain. Defaults to true. */ includeWww?: boolean; }; export type DomainProps = { /** Application load balancer that serves the app. */ originLoadBalancer: elbv2.IApplicationLoadBalancer; /** Domain the app is served from, e.g. 'example.com' or 'staging.example.com'. */ domainName: string; /** Existing zone to create records in. Defaults to a new zone for domainName. */ hostedZone?: route53.IHostedZone; /** Redirect www.domainName to domainName. Defaults to true. */ includeWww?: boolean; /** Other domains that should redirect to `domainName` rather than serve the app themselves. */ redirectDomains?: RedirectDomain[]; /** Requests per IP per 5-minute window before the edge WAF starts blocking the client. Defaults to 2000. */ rateLimitPerIp?: number; }; /** * An origin whose served content is versioned by a cache key. The key must * change whenever the content changes, so a cache can be invalidated exactly * once per update. */ export interface Cacheable extends IConstruct { readonly cacheKey: string; } /** * A domain served from an internal ALB via a CloudFront VPC origin (the ALB is never exposed to * the public internet), with an edge WAF rate limit and an optional set of other domains that * redirect to it. */ export declare class Domain extends Construct { readonly hostedZone: route53.IHostedZone; readonly certificate: certificateManager.Certificate; readonly distribution: cloudfront.Distribution; readonly redirectDistribution?: cloudfront.Distribution; constructor(scope: Construct, id: string, props: DomainProps); /** Call with a versioned origin to clear the CloudFront cache when its content changes. */ invalidateOnUpdate(origin: Cacheable): void; }