UNPKG

cdk-nextjs-standalone

Version:

Deploy a NextJS app to AWS using CDK and OpenNext.

78 lines (77 loc) 2.73 kB
import type { NextjsBucketDeploymentOverrides } from '../'; import type { aws_s3, aws_s3_assets } from 'aws-cdk-lib'; /** * OptionalNextjsBucketDeploymentProps */ export interface OptionalNextjsBucketDeploymentProps { /** * If `true` then files will be zipped before writing to destination bucket. * Useful for Lambda functions. * @default false * @stability stable */ readonly zip?: boolean; /** * Replace placeholders in all files in `asset`. * Placeholder targets are * defined by keys of record. Values to replace placeholders with are defined * by values of record. * @stability stable */ readonly substitutionConfig?: Record<string, string>; /** * The number of files to upload in parallel. * @stability stable */ readonly queueSize?: number; /** * Mapping of files to PUT options for `PutObjectCommand`. * Keys of * record must be a glob pattern (uses micromatch). Values of record are options * for PUT command for AWS SDK JS V3. See [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Interface/PutObjectRequest/) * for options. If a file matches multiple globs, configuration will be * merged. Later entries override earlier entries. * * `Bucket`, `Key`, and `Body` PUT options cannot be set. * @stability stable */ readonly putConfig?: Record<string, Record<string, string>>; /** * If `true`, then delete old objects in `destinationBucket`/`destinationKeyPrefix` **after** uploading new objects. Only applies if `zip` is `false`. * Old objects are determined by listing objects * in bucket before creating new objects and finding the objects that aren't in * the new objects. * * Note, if this is set to true then clients who have old HTML files (browser tabs opened before deployment) * will reference JS, CSS files that do not exist in S3 reslting in 404s. * @default false * @stability stable */ readonly prune?: boolean; /** * Override props for every construct. * @stability stable */ readonly overrides?: NextjsBucketDeploymentOverrides; /** * Destination S3 Bucket Key Prefix. * @stability stable */ readonly destinationKeyPrefix?: string; /** * Enable verbose output of Custom Resource Lambda. * @default false * @stability stable */ readonly debug?: boolean; /** * Destination S3 Bucket. * @stability stable */ readonly destinationBucket?: aws_s3.IBucket; /** * Source `Asset`. * @stability stable */ readonly asset?: aws_s3_assets.Asset; }