OptionalbuildBuild cache configuration. When enabled, provisions an S3 bucket for framework build caches and exports the bucket name.
Optionalbucket?: s3.IBucketBYO S3 bucket for build cache storage. Creates one if not provided.
OptionalcdnCDN (CloudFront) configuration.
OptionalcontentSecurityPolicy?: stringOptionalgeoRestriction?: { countries: string[]; type: "whitelist" | "blacklist" }OptionalpriceClass?: PriceClassOptionalquotas?: QuotaOverridesOverrides for the adjustable AWS Service Quotas this distribution draws
on — cacheBehaviors (CloudFront behaviors per distribution),
edgeFunctions (Lambda@Edge associations), and headerPolicies
(response-headers policies per account). Omitted fields use AWS
defaults.
Set a field ONLY to match a quota increase AWS has actually granted: synth cannot verify your real quota, so an over-set value does not raise the AWS ceiling — it just moves the failure from a clear synth error to an opaque CloudFormation rollback at deploy.
OptionalresponseHeadersPolicy?: IResponseHeadersPolicyBring-your-own ResponseHeadersPolicy. When provided, the construct skips creating its own policy — use this to share a single policy across multiple hosting stacks and avoid the account-level limit (default 20, max 200 via service-quota increase).
Create a shared policy once (e.g. in a shared-infra stack):
const sharedPolicy = new ResponseHeadersPolicy(sharedStack, 'SharedPolicy', { ... });
Then import by ID in each hosting stack:
cdn: { responseHeadersPolicy: ResponseHeadersPolicy.fromResponseHeadersPolicyId(this, 'Imported', policyId) }
OptionalssrDefaultTtl?: DurationDefault TTL for SSR/compute cache behaviors when the origin response
does not include a Cache-Control header. Set this to enable
CloudFront edge caching of SSR responses and improve hit ratio.
When set, SSR responses without an explicit Cache-Control header
are cached at the edge for this duration. The origin can always
override via s-maxage or no-store.
OptionalwebAclArn?: stringARN of an existing WAFv2 WebACL to associate with the CloudFront
distribution. Use this when you manage WAF rules externally (e.g.
via a shared security account) or need advanced WAF features beyond
the built-in waf.enabled rate-limiting.
Takes precedence over waf.enabled — when set, the built-in WAF
construct is not created.
OptionalcomputeCompute (Lambda) overrides for all compute resources.
Optionalenvironment?: Record<string, string>Additional environment variables to inject into all compute Lambda functions. Merged with (and overrides) any environment variables declared in the deploy manifest's compute resources.
OptionalimageOptimization?: { reservedConcurrency?: number }Reserved concurrent executions for the image-optimization Lambda. Default: undefined (no reservation).
Historically this was hardcoded to 10, which broke cdk deploy on
fresh AWS accounts: the default account-level unreserved-concurrency
limit is 10, so reserving all 10 for image-opt drops the account
below its required minimum and Lambda rejects the stack with a 400.
Defaulting to no reservation keeps deploys working out of the box
while still letting operators cap image-opt explicitly.
OptionallogRetention?: RetentionDaysOptionalmemorySize?: numberOptionalprovisionedConcurrency?: numberProvisioned concurrency for the SSR Lambda (cold-start elimination).
When > 0, the construct creates a live alias with this many
always-warm execution environments and points the SSR REST API
integration at the alias. Default: undefined (no provisioning).
OptionalreservedConcurrency?: numberOptionaltimeout?: Duration | numberLambda timeout. Accepts either a cdk.Duration (preferred) or a
number of seconds for ergonomics — the L3 normalizes both to
Duration before handing them to the Lambda construct. A plain
number used to slip through the type at the user-facing API
surface (e.g. when consumed via JS-compiled wrappers) and crash
synth deep inside aws-cdk-lib with props.timeout.toSeconds is not a function. Coercing here makes that surface forgiving.
Optionaltracing?: { otelEndpoint: string; otelHeaders?: string; serviceName?: string }4.1 — OpenTelemetry env hooks for SSR / image-opt / revalidation Lambdas.
Optionalwarmup?: { rate: Duration }2.1 — synthetic warmup schedule.
OptionalconfigNamespace/cache config for config values (SSM Parameter Store). Defaults
to the neutral /hosting/config prefix. Governs prefix, stage, cacheTtlSeconds.
OptionaldomainCustom domain configuration.
OptionalenvironmentCustom environment variables for all compute functions. A value may be:
secret('K') marker → wired at runtime from Secrets Manager (read via getSecret('K')),config('K') marker → wired at runtime from SSM Parameter Store (read via getConfig('K')),ISecret / IParameter handle → granted + wired identically (read via getSecret/getConfig).For each managed/BYO value the store LOCATOR (never the value) is injected and
the compute role granted read+decrypt. Domain markers resolve at synth and
must go through the async wrapper (e.g. Hosting.create()).
OptionalerrorCustom error page configuration. Provide paths to HTML files for custom 404 and 500 error responses.
OptionalnotFound?: stringPath to a custom 404 HTML file (relative to project root).
OptionalserverError?: stringPath to a custom 500 HTML file (relative to project root).
OptionalloggingCloudFront access logging configuration.
Deploy manifest produced by the framework adapter.
OptionalmonitoringDefault CloudWatch alarms (P3.1 + P3.2). On by default. When
enabled, the L3 wires CloudFront 5xx, Lambda error / throttle,
and revalidation-DLQ alarms to an SNS topic. Opt out with
{ enabled: false }. See MonitoringConstruct.
OptionalsecretNamespace/cache config for secret values (Secrets Manager). Defaults to
the neutral /hosting/secrets prefix; a branded consumer overrides it (e.g.
Blocks passes /blocks/secrets). Governs prefix, stage, cacheTtlSeconds.
OptionalskewCookie-based skew protection. When enabled, users mid-session keep receiving assets from their original build, preventing asset mismatches during rolling deployments.
OptionalmaxAge?: numberHow long to honor old build cookies (seconds). Default: 86400 (24h)
OptionalskipSkips region validation for WAF WebACL (must be us-east-1 for CloudFront), ACM certificates (must be us-east-1 for CloudFront), and Lambda Web Adapter compatibility checks. Useful for testing.
OptionalstorageS3 storage configuration.
OptionalbuildRetentionDays?: numberOptionaldeployIntervalDays?: numberAdvisory hint used at synth to warn when deploy cadence ≥ retention (#480).
Optionaldeployment?: { ephemeralStorageMiB?: number; memoryLimit?: number }Resources for the Lambda that uploads static assets to S3 (CDK's
BucketDeployment). CDK defaults this Lambda to 128 MB memory and a
512 MiB /tmp — too small for large static sites, which then OOM or
run out of disk with an opaque CloudFormation error at deploy time.
The L3 raises the defaults to 1024 MB / 1024 MiB; override here if a
very large build still hits the ceiling.
OptionalephemeralStorageMiB?: number/tmp size (MiB) for the asset-upload Lambda.
OptionalmemoryLimit?: numberMemory (MiB) for the asset-upload Lambda.
Optionalencryption?: "S3_MANAGED" | "KMS"OptionalencryptionKey?: IKeyOptionalinventory?: { enabled: boolean }3.3 — opt-in daily S3 inventory of builds/.
OptionalretainOnDelete?: booleanOptionalwafWAF configuration.
Props for the HostingConstruct.
This construct is FRAMEWORK-AGNOSTIC. It reads a DeployManifest and provisions infrastructure accordingly. It never imports Next.js or OpenNext.