cdk-nextjs 0.5.16 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +290 -183
- package/.jsii.tabl.json +1 -1
- package/API.md +244 -4
- package/README.md +2 -2
- package/docs/breaking-changes.md +53 -0
- package/lib/generated-structs/OptionalNextjsDistributionProps.d.ts +3 -0
- package/lib/generated-structs/OptionalNextjsDistributionProps.js +1 -1
- package/lib/image-optimization/handler-utils.d.ts +7 -5
- package/lib/image-optimization/handler-utils.js +17 -11
- package/lib/image-optimization/handler-utils.test.js +42 -6
- package/lib/image-optimization/handler.mjs +19 -5
- package/lib/nextjs-api.d.ts +26 -0
- package/lib/nextjs-api.js +41 -13
- package/lib/nextjs-api.test.d.ts +1 -0
- package/lib/nextjs-api.test.js +144 -0
- package/lib/nextjs-build/nextjs-build.d.ts +8 -0
- package/lib/nextjs-build/nextjs-build.js +12 -2
- package/lib/nextjs-cache.js +1 -1
- package/lib/nextjs-compute/nextjs-containers.js +1 -1
- package/lib/nextjs-compute/nextjs-functions.js +1 -1
- package/lib/nextjs-compute/nextjs-image-function.d.ts +10 -0
- package/lib/nextjs-compute/nextjs-image-function.js +3 -2
- package/lib/nextjs-distribution.d.ts +11 -0
- package/lib/nextjs-distribution.js +16 -10
- package/lib/nextjs-post-deploy.js +1 -1
- package/lib/nextjs-static-assets.d.ts +18 -0
- package/lib/nextjs-static-assets.js +33 -6
- package/lib/nextjs-static-assets.test.d.ts +1 -0
- package/lib/nextjs-static-assets.test.js +58 -0
- package/lib/root-constructs/nextjs-base-construct.d.ts +38 -1
- package/lib/root-constructs/nextjs-base-construct.js +41 -3
- package/lib/root-constructs/nextjs-global-containers.d.ts +6 -1
- package/lib/root-constructs/nextjs-global-containers.js +11 -5
- package/lib/root-constructs/nextjs-global-functions.d.ts +5 -0
- package/lib/root-constructs/nextjs-global-functions.js +10 -4
- package/lib/root-constructs/nextjs-regional-containers.js +1 -1
- package/lib/root-constructs/nextjs-regional-functions.js +5 -5
- package/lib/utils/base-path.d.ts +40 -0
- package/lib/utils/base-path.js +123 -0
- package/lib/utils/base-path.test.d.ts +1 -0
- package/lib/utils/base-path.test.js +163 -0
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -9032,7 +9032,7 @@
|
|
|
9032
9032
|
},
|
|
9033
9033
|
"name": "cdk-nextjs",
|
|
9034
9034
|
"readme": {
|
|
9035
|
-
"markdown": "\n[](https://www.npmjs.org/package/cdk-nextjs)\n\n\n# CDK Next.js Construct Library\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nDeploy [Next.js](https://nextjs.org/) apps on [AWS](https://aws.amazon.com/) with the [AWS CDK](https://aws.amazon.com/cdk/).\n\n## Features\n\n- Supports all features of Next.js App and Pages Router for [Node.js Runtime](https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#nodejs-runtime).\n- Choose your AWS architecture for Next.js with the supported constructs: `NextjsGlobalFunctions`, `NextjsGlobalContainers`, `NextjsRegionalContainers`, `NextjsRegionalFunctions`.\n- Global Content Delivery Network (CDN) built with [Amazon CloudFront](https://aws.amazon.com/cloudfront/) to deliver content with low latency and high transfer speeds.\n- Serverless functions powered by [AWS Lambda](https://aws.amazon.com/lambda/) or serverless containers powered by [AWS Fargate](https://aws.amazon.com/fargate/).\n- Static assets (JS, CSS, public folder) are stored and served from [Amazon Simple Storage Service (S3)](https://aws.amazon.com/s3/) for all constructs (except `NextjsRegionalContainers`) to decrease latency and reduce compute costs by serving directly from S3.\n- [Optimized images](https://nextjs.org/docs/pages/building-your-application/optimizing/images), [data cache](https://nextjs.org/docs/app/building-your-application/caching#data-cache), and [full route cache](https://nextjs.org/docs/app/building-your-application/caching#full-route-cache) are shared across compute with [Amazon Simple Storage Service (S3)](https://aws.amazon.com/s3/) with supporting metadata in [Amazon DynamoDB](https://aws.amazon.com/dynamodb).\n- Customize every construct via `overrides`.\n- AWS security and operational best practices are utilized, guided by [cdk-nag](https://github.com/cdklabs/cdk-nag).\n- First class support for [monorepos](https://monorepo.tools/).\n- [Bring Your Own Resources](#bring-your-own-resources) — import existing AWS resources (CloudFront distributions, ECS clusters, ALBs, S3 buckets, DynamoDB tables).\n- [AWS GovCloud (US)](https://aws.amazon.com/govcloud-us) compatible with `NextjsRegionalFunctions` and `NextjsRegionalContainers`.\n\n## Prerequisites\n\n- Next.js app running v16.2 or higher. If you don't have one yet - follow [these steps](https://nextjs.org/docs/getting-started) to create one.\n- [AWS Cloud Development Kit](https://docs.aws.amazon.com/cdk/v2/guide/home.html) app either in the same package or separate package. cdk-nextjs supports monorepos.\n- Docker compatible container engine - we recommend [Rancher Desktop](https://rancherdesktop.io/) with dockerd (moby).\n- [Node.js](https://nodejs.org/en) v24 (or LTS)\n\n## Getting Started\n\n1. Install `cdk-nextjs` in the package(s) containing your CDK and Next.js app with `npm i cdk-nextjs`\n2. Update next.config.ts to include `adapterPath`:\n\n```ts\nimport { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: import.meta.resolve(\"cdk-nextjs/adapter\"), // for ESM\n // adapterPath: require.resolve(\"cdk-nextjs/adapter\"), // for CJS\n};\n\nexport default nextConfig;\n```\n\n3. Deploy your Next.js app to AWS: `cdk deploy`. Make sure you have [AWS credentials](https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-configure.html) configured.\n4. Visit URL printed in terminal (CloudFormation Output) to view your Next.js app!\n\n### cdk-nextjs Created Dockerfile\n\ncdk-nextjs will generate a Dockerfile in your Next.js app's directory. cdk-nextjs does not have the ability to clean up the Dockerfile after the container is built so you can either add it to source control or gitignore it. When detectd, cdk-nextjs will not overwrite this Dockerfile so you're free to customize it.\n\n## Basic Example CDK App\n\n```ts\nimport { App, Stack, StackProps } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport { NextjsGlobalFunctions } from \"cdk-nextjs\";\nimport { join } from \"node:path\";\n\nclass WebStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n healthCheckPath: \"/api/health\",\n });\n }\n}\n\nconst app = new App();\n\nnew WebStack(app, \"web-stack\");\n```\n\nSee [examples/](./examples/) for more usage examples.\n\n## Configuration\n\ncdk-nextjs supports configuration via environment variables. These are automatically set by the construct during deployment, but you can override them for custom behavior.\n\n### Cache Configuration\n\n#### `CDK_NEXTJS_MEMORY_CACHE_TTL_MS`\n\nTime to live in milliseconds for in-memory cache entries. After this duration, entries expire and are removed from the cache.\n\n**Important**: Due to the distributed nature of compute instances (Lambda functions, ECS Fargate containers, etc.), the memory cache by default provides eventual consistency across instances. Tag revalidations will clear the cache on the instance that processes the revalidation, but other instances may serve stale data until their cache entries expire. If you require strong consistency, set this to `0` to disable the memory cache (all requests will fall through to S3 + DynamoDB).\n\n**Default**: `3600000` (1 hour)\n\n**Examples**:\n\n- Short TTL (5 minutes): `300000` - for frequently changing data\n- Medium TTL (1 hour): `3600000` - balanced between freshness and performance\n- Long TTL (24 hours): `86400000` - for mostly static content\n\n**Trade-offs**:\n\n- Lower values: More cache misses, fresher data, higher S3/DynamoDB costs\n- Higher values: Fewer cache misses, better performance, but longer stale data windows\n\n#### `CDK_NEXTJS_MEMORY_CACHE_MAX_ENTRIES`\n\nMaximum number of cache entries to store in memory. When this limit is reached, the least recently used (LRU) entry is evicted.\n\n**Default**: `1000`\n\n**Examples**:\n\n- Small cache: `100` - minimal memory footprint for simple apps\n- Medium cache: `1000` - good balance for typical applications\n- Large cache: `10000` - for high-traffic apps with many unique pages\n\n**Trade-offs**:\n\n- Lower values: Less memory usage, more cache evictions\n- Higher values: More memory usage, fewer cache evictions, better hit rates\n\n**Memory considerations**: Each entry stores the full cache value (HTML, JSON, etc.). A typical page cache might be 10-100KB, so 1000 entries ≈ 10-100MB of memory. Consider your compute environment's memory limits (Lambda: 128MB-10GB, Fargate: 512MB-30GB) and size accordingly.\n\n### Infrastructure Configuration\n\nThe following environment variables are automatically set by the construct and typically don't need to be modified:\n\n#### `CDK_NEXTJS_BUILD_ID`\n\nUnique identifier for the Next.js build. Used for cache isolation between deployments.\n\n#### `CDK_NEXTJS_CACHE_BUCKET_NAME`\n\nS3 bucket name for storing cached data (optimized images, data cache, full route cache).\n\n#### `CDK_NEXTJS_REVALIDATION_TABLE_NAME`\n\nDynamoDB table name for tracking cache revalidations and tag-to-cache-key mappings.\n\n#### `DEBUG`\n\nSet to `cdk-nextjs:*` to set debug logs. This is especially useful to see cache handler activity.\n\n## Architecture\n\n### `NextjsGlobalFunctions`\n\nArchitecture includes [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) Functions to respond to dynamic requests and [CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html) Distribution to globally serve requests and distribute static assets. Use this construct when you have unpredictable traffic, can afford occasional latency (i.e. cold starts - [typically 1% of production traffic](https://aws.amazon.com/blogs/compute/operating-lambda-performance-optimization-part-1/)), and/or want the most granular pricing model. ([code](./src/root-constructs/nextjs-global-functions.ts))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service cloudfront(server)[CloudFront Distribution] in aws\n service s3static(disk)[S3 Static Assets] in aws\n service lambda(server)[Lambda Function] in aws\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:cloudfront\n cloudfront:R --> L:s3static\n cloudfront:R --> L:lambda\n lambda:R --> L:dynamodb\n lambda:R --> L:s3cache\n```\n\n### `NextjsGlobalContainers`\n\nArchitecture includes [ECS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) containers to respond to dynamic requests and [CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html) Distribution to globally serve requests and distribute static assets. Use this option when you have predictable traffic, need the lowest latency, and/or can afford a less granular pricing model. ([code](./src/root-constructs/nextjs-global-containers.ts))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group vpc[VPC] in aws\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service cloudfront(server)[CloudFront Distribution] in aws\n service s3static(disk)[S3 Static Assets] in aws\n service alb(server)[Application Load Balancer] in vpc\n service fargate(server)[ECS Fargate Containers] in vpc\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:cloudfront\n cloudfront:R --> L:s3static\n cloudfront:R --> L:alb\n alb:R --> L:fargate\n fargate:R --> L:dynamodb\n fargate:R --> L:s3cache\n```\n\n### `NextjsRegionalContainers`\n\nArchitecture includes [ECS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) containers to respond to dynamic requests and [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/) to regionally serve requests. Use this options when you cannot use Amazon CloudFront (i.e. [AWS GovCloud](https://aws.amazon.com/govcloud-us/?whats-new.sort-by=item.additionalFields.postDateTime&whats-new.sort-order=desc)). ([code](./src/root-constructs/nextjs-regional-containers.ts#L41))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group vpc[VPC] in aws\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service alb(server)[Application Load Balancer] in vpc\n service fargate(server)[ECS Fargate Containers] in vpc\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:alb\n alb:R --> L:fargate\n fargate:R --> L:dynamodb\n fargate:R --> L:s3cache\n```\n\n### `NextjsRegionalFunctions`\n\nArchitecture includes [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) Functions to respond to dynamic requests and [API Gateway REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html) to regionally serve requests and distribute static assets. Use this options when you cannot use Amazon CloudFront (i.e. [AWS GovCloud](https://aws.amazon.com/govcloud-us/?whats-new.sort-by=item.additionalFields.postDateTime&whats-new.sort-order=desc)). ([code](./src/root-constructs/nextjs-regional-functions.ts))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service apigateway(server)[API Gateway REST API] in aws\n service s3static(disk)[S3 Static Assets] in aws\n service lambda(server)[Lambda Function] in aws\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:apigateway\n apigateway:R --> L:s3static\n apigateway:R --> L:lambda\n lambda:R --> L:dynamodb\n lambda:R --> L:s3cache\n```\n\n## Why\n\nThe simplest path to deploy Next.js is on [Vercel](https://vercel.com/) - the Platform-as-a-Service company behind Next.js. However, deploying to Vercel can be expensive and some developers want all of their workloads running _directly_ on AWS. Developers can deploy Next.js on AWS through [AWS Amplify Hosting](https://docs.aws.amazon.com/amplify/latest/userguide/ssr-Amplifysupport.html), but Amplify does not support all Next.js features and manages AWS resources for you so they cannot be customized. If Amplify meets your requirements we recommend you use it, but if you want to use all Next.js features or want more visibility into the AWS resources then this construct is for you.\n\n## Design Principles\n\n- Treat Next.js as black box. Minimize reliance on Next.js internal APIs to reduce chance of incompatibility between this construct and future versions of Next.js.\n- Security first.\n- One architecture does not fit all.\n- Enable customization everywhere.\n\n## Bring Your Own Resources\n\ncdk-nextjs supports importing existing AWS resources instead of creating new ones. This is especially useful for per-branch (MR/PR) environments where you deploy shared infrastructure once and spin up lightweight branch stacks that reuse it.\n\n### Supported Resources\n\n| Resource | Prop | Available On |\n| --------------------------- | -------------------- | ---------------------------------------------------- |\n| S3 Cache Bucket | `cacheBucket` | All constructs |\n| DynamoDB Revalidation Table | `revalidationTable` | All constructs |\n| S3 Static Assets Bucket | `staticAssetsBucket` | All constructs |\n| CloudFront Distribution | `distribution` | `NextjsGlobalFunctions`, `NextjsGlobalContainers` |\n| ECS Cluster | `ecsCluster` | `NextjsGlobalContainers`, `NextjsRegionalContainers` |\n| ALB | `alb` | `NextjsGlobalContainers`, `NextjsRegionalContainers` |\n\n### Resource Isolation\n\n- **Cache bucket and DynamoDB table** are isolated by `buildId` prefix. Multiple branches safely share one bucket/table with no conflicts.\n- **Static assets bucket** — Next.js includes content hashes in static asset filenames, so different branches deploying the same file will produce identical content. It's safe for branches to overwrite each other. If you're already using `basePath` for routing, assets will naturally be prefixed by it.\n\n### Shared ALB and `removeAutoCreatedListener()`\n\n`ApplicationLoadBalancedFargateService` always creates a listener on port 80 — there is no opt-out. When you import an ALB that already has a listener on that port, the duplicate causes a deployment failure. Since CDK doesn't expose a way to prevent this, `removeAutoCreatedListener()` surgically removes the generated CloudFormation resources: the `CfnListener`, its security group ingress rule, rebuilds the ECS service `DependsOn` without the deleted listener, and removes auto-created `CfnOutput` resources:\n\n```ts\nconst nextjs = new NextjsRegionalContainers(this, \"Nextjs\", {\n // ...\n alb: sharedAlb,\n ecsCluster: sharedCluster,\n});\nnextjs.nextjsContainers.removeAutoCreatedListener();\n```\n\n### Examples\n\nSee [examples/bring-your-own/](./examples/bring-your-own/) for a complete deployable example with shared infrastructure and per-branch host-header routing.\n\n## Preview Environments (Per-Branch Deployments)\n\ncdk-nextjs can deploy ephemeral preview environments per merge request (MR) or pull request (PR). The recommended approach uses subdomain-based routing (`pr-123.app.example.com`) so each preview environment runs the same Next.js build as production — no `basePath` configuration or separate builds required.\n\nSee [examples/bring-your-own/](./examples/bring-your-own/) for a fully deployable example using `NextjsRegionalContainers` with a shared ALB, ECS Cluster, S3 buckets, and DynamoDB table — connected via SSM Parameter Store.\n\n### Prerequisites\n\n- Wildcard DNS record: `*.app.example.com` → your routing layer (ALB, CloudFront, API Gateway)\n- Wildcard ACM certificate: `*.app.example.com`\n\n### Per-Architecture Recommendations\n\n#### `NextjsGlobalContainers` and `NextjsRegionalContainers` (ALB-based)\n\nSubdomain routing via ALB host-based listener rules. This is the fastest and simplest approach. For `NextjsGlobalContainers`, CloudFront forwards the `Host` header to the ALB origin, so the ALB handles all branch routing — no CloudFront changes needed per branch.\n\nSee [examples/bring-your-own/](./examples/bring-your-own/) for the full implementation.\n\n#### `NextjsRegionalFunctions` (API Gateway)\n\nSubdomain routing via API Gateway custom domain mappings.\n\n1. Deploy shared infrastructure once: S3 buckets, DynamoDB table\n2. Per branch, deploy a cdk-nextjs stack that imports shared resources and creates its own API Gateway\n3. Create an API Gateway custom domain (`pr-123.app.example.com`) mapped to the branch's API stage\n4. Tear down the branch stack on MR close\n\n#### `NextjsGlobalFunctions` (Lambda + CloudFront)\n\nRequires a separate cdk-nextjs stack per branch, each with its own CloudFront distribution. CloudFront cannot route to different Lambda Function URL origins based on the `Host` header — origin selection is determined by cache behavior path patterns, not request headers.\n\n1. Deploy shared infrastructure once: S3 buckets, DynamoDB table\n2. Per branch, deploy a full cdk-nextjs stack that imports shared resources (`cacheBucket`, `revalidationTable`, `staticAssetsBucket`) but creates its own CloudFront distribution and Lambda function\n3. Point `pr-123.app.example.com` DNS to the branch's CloudFront distribution\n4. Tear down the branch stack on MR close\n\nNote: CloudFront distributions take several minutes to create/update, so this architecture has the slowest preview environment spin-up time.\n\n## Limitations\n\n- If using `NextjsGlobalFunctions` or `NextjsGlobalContainers` (which use CloudFront), the number of top level files/directories cannot exceed 25, the max number of behaviors a CloudFront Distribution supports. We recommend you put all of your public assets into one top level directory (i.e. public/static) so you don't reach this limit. See [CloudFront Quotas](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html) for more information.\n- If using `NextjsGlobalFunctions`, when [revalidating data in Next.js](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#on-demand-revalidation) (i.e. [revalidatePath](https://nextjs.org/docs/app/api-reference/functions/revalidatePath)), the CloudFront Cache will still hold stale data. You'll need to use AWS SDK JS V3 [CreateInvalidationCommand](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudfront/Class/CreateInvalidationCommand/) to manually invalidate the path in CloudFront. See more [here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html).\n- If using `NextjsGlobalFunctions`, setting an Authorization header won't work by default because of Lambda Function URL with IAM Auth is already using the Authorization header. You can use the `AWS_LWA_AUTHORIZATION_SOURCE` environment variable of [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter) to set an alternative Authorization header in the client which will then be set to the Authorization header when it reaches your app.\n- `NextjsRegionalFunctions` streaming depends on whether your server Lambda supports response streaming (e.g. [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter)'s `AWS_LWA_INVOKE_MODE`) — override `overrides.nextjsApi.dynamicIntegrationProps.responseTransferMode` to `BUFFERED` if it doesn't, otherwise API Gateway returns a 500 for every request.\n- If using `NextjsRegionalFunctions` without a custom domain, API Gateway REST APIs require a [stage name](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-stages.html) (default: `/prod`) to be specified. This causes links to pages and static assets to break because they're not prefixed with the stage name. You can work around this issue by specifying [basePath](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath) in next.config.js as your stage name. Additionally, you'll need to add middleware logic to rewrite requests to include the stage name because API Gateway does not include the stage name in the path passed to Lambda. See [examples/app-playground/middleware.ts](./examples/app-playground/middleware.ts).\n\n## Additional Security Recommendations\n\nThis construct by default implements all AWS security best practices that a CDK construct library reasonably can considering cost and complexity. Below are additional security practices we recommend you implement within your CDK app. Please see them below:\n\n- [VPC Flow Logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html). See [examples/](./examples) for sample implementation.\n- [Scan ECR Images For Vulnerabilities](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html).\n- For `NextjsGlobalFunctions` and `NextjsGlobalContainers`, [CloudFront Access Logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html). See [examples/](./examples) for sample implementation.\n- For `NextjsGlobalContainers` and `NextjsRegionalContainers`, use [ALB HTTPS Listener](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html)\n- If using `NextjsGlobalContainers` and `NextjsRegionalContainers`, enable `ReadonlyRootFilesystem`. This will remove ability to use Static On-Demand feature of Next.js so it's not enabled by default, but is recommended for security.\n\n## Estimated Costs\n\n### Assumptions\n\nThe following basic assumptions were used for a typical medium Next.js app. See [docs/usage.xlsx](./docs/usage.xlsx) for detailed assumptions and usage per construct type that you can plug into AWS Pricing Calculator.\n\n| Metric | Value |\n| ------------------------------------------------------------ | ----- |\n| Monthly Active Users | 1K |\n| Pages Visited Per Month Per User | 100 |\n| Avg Request Size | 50KB |\n| Static Requests Per Page (js, css, etc) | 15 |\n| Static Requests Cache Hit % | 50% |\n| Static Assets Size | 10GB |\n| Dynamic Requests Per Page (document, optimized images, etc.) | 5 |\n| Dynamic Cache Read % | 50% |\n| Dynamic Cache Write % | 5% |\n| Dynamic Cache Data Size | 10GB |\n| Average Dynamic Cache Request Size | 100KB |\n| Dynamic Revalidate Tag % | 1% |\n\nMore Details:\n\n- Assume ARM architecture for compute\n- AWS Region: us-east-1\n- Excludes charges related to: CloudWatch Logs, NAT Gateway data processing\n\n### NextjsGlobalFunctions\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=23611f6fea87ef05d5fe87c33135ddde43b17a98)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ---------- | ---------------------------------------------- | ---------------------------- |\n| Lambda | 500K requests, 2 GB memory, 150ms avg duration | $0.00 (Always Free Tier) |\n| CloudFront | 2M requests, 100 GB transfer to internet | $0.00 (Always Free Tier) |\n| S3 | 20 GB storage, 1M GET, 250K PUT requests | $2.11 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| Total | | $8.09 |\n\n### NextjsGlobalContainers\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=02f0073e612d1eee2a7ccace2c636adc5f0acab7)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ----------- | ---------------------------------------- | ---------------------------- |\n| ECS Fargate | 1 task (1 vCPU, 2 GB) | $28.44 |\n| ALB | 1 LB, 1.04GB/hr, 5.79 conn/sec | $22.50 |\n| CloudFront | 2M requests, 100 GB transfer to internet | $0.00 (Always Free Tier) |\n| S3 | 20 GB storage, 1M GET, 250K PUT requests | $2.11 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| VPC | NAT Gateway, 2 AZs | $65.70 |\n| Total | | $121.25 |\n\n### NextjsRegionalContainers\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=e214abe60eb4e24fc5866d07ef4355393261af3c)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ----------- | ------------------------------------------ | ---------------------------- |\n| ECS Fargate | 1 task (2 vCPU, 4 GB), always on | $28.44 |\n| ALB | 1 LB, 4.17 GB/hr, 23.15 conn/sec | $40.78 |\n| S3 | 10 GB storage, 250K GET, 250K PUT requests | $1.58 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| VPC | NAT Gateway, 2 AZs | $65.70 |\n| Total | | $139.00 |\n\n### NextjsRegionalFunctions\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=60da38c7993c1baeee2fee4bd19ba6441608bb15)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ----------- | ---------------------------------------------- | ---------------------------- |\n| Lambda | 500K requests, 2 GB memory, 150ms avg duration | $0.00 (Always Free Tier) |\n| API Gateway | 2M requests | $7.00 |\n| S3 | 10 GB storage, 250K GET, 250K PUT requests | $1.58 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| Total | | $11.08 |\n\n## Performance\n\n[Artillery Playwright](https://www.artillery.io/docs/reference/engines/playwright#overview) app playground example load tests results with 1K concurrent users. Reproduce with `pnpm test-fargate:lg` within `examples/load-tests`.\n\n### NextjsGlobalFunctions\n\n<details>\n<summary>`NextjsGlobalFunctions` Performance Details</summary>\n\n```bash\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr:\n min: ......................................................................... 6.3\n max: ......................................................................... 5017.4\n mean: ........................................................................ 11.5\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 22.9\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr/1:\n min: ......................................................................... 3.2\n max: ......................................................................... 560.6\n mean: ........................................................................ 9.4\n median: ...................................................................... 5.4\n p95: ......................................................................... 11.1\n p99: ......................................................................... 162.4\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr/2:\n min: ......................................................................... 3.1\n max: ......................................................................... 1511.9\n mean: ........................................................................ 9.2\n median: ...................................................................... 5.2\n p95: ......................................................................... 10.7\n p99: ......................................................................... 149.9\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr/3:\n min: ......................................................................... 3.4\n max: ......................................................................... 131.1\n mean: ........................................................................ 7.1\n median: ...................................................................... 5.3\n p95: ......................................................................... 10.1\n p99: ......................................................................... 64.7\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssg:\n min: ......................................................................... 6.4\n max: ......................................................................... 5015.1\n mean: ........................................................................ 11.5\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 23.3\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssg/3:\n min: ......................................................................... 2.9\n max: ......................................................................... 98\n mean: ........................................................................ 5.1\n median: ...................................................................... 4.6\n p95: ......................................................................... 8.2\n p99: ......................................................................... 12.8\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssr:\n min: ......................................................................... 6.4\n max: ......................................................................... 5018.6\n mean: ........................................................................ 11.3\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 23.3\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssr/2:\n min: ......................................................................... 83.4\n max: ......................................................................... 150.7\n mean: ........................................................................ 119\n median: ...................................................................... 111.1\n p95: ......................................................................... 147\n p99: ......................................................................... 147\nbrowser.page.TTFB.https://abc123.cloudfront.net/streaming:\n min: ......................................................................... 6.4\n max: ......................................................................... 5015.2\n mean: ........................................................................ 11.8\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 23.3\n```\n\n</details>\n\n\n\n### NextjsGlobalContainers\n\n<details>\n<summary>`NextjsGlobalContainers` Performance Details</summary>\n\n```bash\nTODO\n```\n\n</details>\n\n### NextjsRegionalContainers\n\n<details>\n<summary>`NextjsRegionalContainers` Performance Details</summary>\n\n```bash\nTODO\n```\n\n### NextjsRegionalFunctions\n\n<details>\n<summary>`NextjsRegionalFunctions` Performance Details</summary>\n\n```bash\nTODO\n```\n\n</details>\n\n## Guides\n\n- [Caching Guide](./docs/caching-guide.md)\n- [Pruning Guide](./docs/pruning-guide.md)\n- [Next Build Output Guide](./docs/next-build-output-guide.ts)\n- [Development Guide](./docs/development-guide.ts)\n\n## Contributing\n\nSteps to build locally:\n\n1. `git clone https://github.com/cdklabs/cdk-nextjs.git`\n2. `cd cdk-nextjs`\n3. `pnpm i && pnpm compile && pnpm build`\n\nThis project uses Projen, so make sure to not edit [Projen](https://projen.io/) created files and only edit .projenrc.ts.\n\n## FAQ\n\nQ: How does this compare to [cdk-nextjs-standalone](https://github.com/jetbridge/cdk-nextjs)?<br/>\nA: cdk-nextjs-standalone relies on [OpenNext](https://github.com/sst/open-next). OpenNext injects custom code to interact with private Next.js APIs. While OpenNext is able to make some optimizations that are great for serverless environments, this comes at an increase maintenance cost and increased chances for breaking changes. A goal of cdk-nextjs is to customize Next.js as little as possible to reduce the maintenance burden and decrease chances of breaking changes.\n\nQ: Why does cdk-nextjs depend upon Next.js v16.2 or higher?\nA: This version is required for [Image Optimization Caching](https://nextjs.org/docs/app/api-reference/config/next-config-js/incrementalCacheHandlerPath#image-optimization-caching) so that cdk-nextjs can depend upon public Next.js API.\n\nQ: How does cdk-nextjs support caching in Next.js?<br/>\nA: See [Caching Guide](./docs/caching-guide.md)\n\nQ: How customizable is the `cdk-nextjs` package for different use cases?<br/>\nA: The `cdk-nextjs` package offers deep customization through _prop-based_ overrides. These can be accessed in the construct props, allowing you to override settings like VPC configurations, CloudFront distribution, and ECS/Fargate setup. For example, you can modify `nextjsBuildProps` to customize the build process or use `nextjsDistributionProps` to adjust how CloudFront handles caching and routing. This level of control makes it easy to adapt the infrastructure to your application’s specific performance, networking, or deployment needs.\n\nQ: How can I use a custom domain with `cdk-nextjs`?<br/>\nA: See [low-cost example](./examples/low-cost/app.ts).\n\nQ: What is difference between `NextjsGlobalFunctionsProps.overrides.nextjsDistribution` and `NextjsGlobalFunctionsProps.overrides.nextjsGlobalFunctions.nextjsDistributionProps`<br/>\nA: `NextjsGlobalFunctionsProps.overrides.nextjsDistribution` allows you to customize any construct's props _within_ `NextjsDistribution` and is likely what you want whereas `NextjsGlobalFunctionsProps.overrides.nextjsGlobalFunctions.nextjsDistributionProps` allows you to customize the props passed into the construct: `NextjsDistribution`. This principle also applies to other similarly named overrides.\n\nQ: Why use container image for `NextjsGlobalFunctions`?<br />\nA: Read [The case for containers on Lambda (with benchmarks)](https://aaronstuyvenberg.com/posts/containers-on-lambda). Also, we depend upon [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter) to transform lambda event payloads into HTTP requests that Next.js expects.\n\nQ: How can I `cdk bootstrap --cloudformation-execution-policies ...` my AWS Account with limited permissions for cdk-nextjs to deploy?<br />\nA: See [docs/cdk-nextjs-cfn-exec-policy.json](./docs/cdk-nextjs-cfn-exec-policy.json). Note, this IAM Policy is scoped to all cdk-nextjs constructs so you can remove services if you know the construct you're using doesn't use that service.\n\n## Acknowledgements\n\nThis construct was built on the shoulders of giants. Thank you to the contributors of [cdk-nextjs-standalone](https://github.com/jetbridge/cdk-nextjs) and [open-next](https://github.com/sst/open-next).\n\n## 🥂 Thanks Contributors\n\nThank you for helping other developers deploy Next.js apps on AWS\n\n<a href=\"https://github.com/cdklabs/cdk-nextjs/graphs/contributors\">\n <img src=\"https://contrib.rocks/image?repo=cdklabs/cdk-nextjs\" />\n</a>\n"
|
|
9035
|
+
"markdown": "\n[](https://www.npmjs.org/package/cdk-nextjs)\n\n\n# CDK Next.js Construct Library\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nDeploy [Next.js](https://nextjs.org/) apps on [AWS](https://aws.amazon.com/) with the [AWS CDK](https://aws.amazon.com/cdk/).\n\n## Features\n\n- Supports all features of Next.js App and Pages Router for [Node.js Runtime](https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#nodejs-runtime).\n- Choose your AWS architecture for Next.js with the supported constructs: `NextjsGlobalFunctions`, `NextjsGlobalContainers`, `NextjsRegionalContainers`, `NextjsRegionalFunctions`.\n- Global Content Delivery Network (CDN) built with [Amazon CloudFront](https://aws.amazon.com/cloudfront/) to deliver content with low latency and high transfer speeds.\n- Serverless functions powered by [AWS Lambda](https://aws.amazon.com/lambda/) or serverless containers powered by [AWS Fargate](https://aws.amazon.com/fargate/).\n- Static assets (JS, CSS, public folder) are stored and served from [Amazon Simple Storage Service (S3)](https://aws.amazon.com/s3/) for all constructs (except `NextjsRegionalContainers`) to decrease latency and reduce compute costs by serving directly from S3.\n- [Optimized images](https://nextjs.org/docs/pages/building-your-application/optimizing/images), [data cache](https://nextjs.org/docs/app/building-your-application/caching#data-cache), and [full route cache](https://nextjs.org/docs/app/building-your-application/caching#full-route-cache) are shared across compute with [Amazon Simple Storage Service (S3)](https://aws.amazon.com/s3/) with supporting metadata in [Amazon DynamoDB](https://aws.amazon.com/dynamodb).\n- Customize every construct via `overrides`.\n- AWS security and operational best practices are utilized, guided by [cdk-nag](https://github.com/cdklabs/cdk-nag).\n- First class support for [monorepos](https://monorepo.tools/).\n- [Bring Your Own Resources](#bring-your-own-resources) — import existing AWS resources (CloudFront distributions, ECS clusters, ALBs, S3 buckets, DynamoDB tables).\n- [AWS GovCloud (US)](https://aws.amazon.com/govcloud-us) compatible with `NextjsRegionalFunctions` and `NextjsRegionalContainers`.\n\n## Prerequisites\n\n- Next.js app running v16.2 or higher. If you don't have one yet - follow [these steps](https://nextjs.org/docs/getting-started) to create one.\n- [AWS Cloud Development Kit](https://docs.aws.amazon.com/cdk/v2/guide/home.html) app either in the same package or separate package. cdk-nextjs supports monorepos.\n- Docker compatible container engine - we recommend [Rancher Desktop](https://rancherdesktop.io/) with dockerd (moby).\n- [Node.js](https://nodejs.org/en) v24 (or LTS)\n\n## Getting Started\n\n1. Install `cdk-nextjs` in the package(s) containing your CDK and Next.js app with `npm i cdk-nextjs`\n2. Update next.config.ts to include `adapterPath`:\n\n```ts\nimport { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: import.meta.resolve(\"cdk-nextjs/adapter\"), // for ESM\n // adapterPath: require.resolve(\"cdk-nextjs/adapter\"), // for CJS\n};\n\nexport default nextConfig;\n```\n\n3. Deploy your Next.js app to AWS: `cdk deploy`. Make sure you have [AWS credentials](https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-configure.html) configured.\n4. Visit URL printed in terminal (CloudFormation Output) to view your Next.js app!\n\n### cdk-nextjs Created Dockerfile\n\ncdk-nextjs will generate a Dockerfile in your Next.js app's directory. cdk-nextjs does not have the ability to clean up the Dockerfile after the container is built so you can either add it to source control or gitignore it. When detectd, cdk-nextjs will not overwrite this Dockerfile so you're free to customize it.\n\n## Basic Example CDK App\n\n```ts\nimport { App, Stack, StackProps } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport { NextjsGlobalFunctions } from \"cdk-nextjs\";\nimport { join } from \"node:path\";\n\nclass WebStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n healthCheckPath: \"/api/health\",\n });\n }\n}\n\nconst app = new App();\n\nnew WebStack(app, \"web-stack\");\n```\n\nSee [examples/](./examples/) for more usage examples.\n\n## Configuration\n\ncdk-nextjs supports configuration via environment variables. These are automatically set by the construct during deployment, but you can override them for custom behavior.\n\n### Cache Configuration\n\n#### `CDK_NEXTJS_MEMORY_CACHE_TTL_MS`\n\nTime to live in milliseconds for in-memory cache entries. After this duration, entries expire and are removed from the cache.\n\n**Important**: Due to the distributed nature of compute instances (Lambda functions, ECS Fargate containers, etc.), the memory cache by default provides eventual consistency across instances. Tag revalidations will clear the cache on the instance that processes the revalidation, but other instances may serve stale data until their cache entries expire. If you require strong consistency, set this to `0` to disable the memory cache (all requests will fall through to S3 + DynamoDB).\n\n**Default**: `3600000` (1 hour)\n\n**Examples**:\n\n- Short TTL (5 minutes): `300000` - for frequently changing data\n- Medium TTL (1 hour): `3600000` - balanced between freshness and performance\n- Long TTL (24 hours): `86400000` - for mostly static content\n\n**Trade-offs**:\n\n- Lower values: More cache misses, fresher data, higher S3/DynamoDB costs\n- Higher values: Fewer cache misses, better performance, but longer stale data windows\n\n#### `CDK_NEXTJS_MEMORY_CACHE_MAX_ENTRIES`\n\nMaximum number of cache entries to store in memory. When this limit is reached, the least recently used (LRU) entry is evicted.\n\n**Default**: `1000`\n\n**Examples**:\n\n- Small cache: `100` - minimal memory footprint for simple apps\n- Medium cache: `1000` - good balance for typical applications\n- Large cache: `10000` - for high-traffic apps with many unique pages\n\n**Trade-offs**:\n\n- Lower values: Less memory usage, more cache evictions\n- Higher values: More memory usage, fewer cache evictions, better hit rates\n\n**Memory considerations**: Each entry stores the full cache value (HTML, JSON, etc.). A typical page cache might be 10-100KB, so 1000 entries ≈ 10-100MB of memory. Consider your compute environment's memory limits (Lambda: 128MB-10GB, Fargate: 512MB-30GB) and size accordingly.\n\n### Infrastructure Configuration\n\nThe following environment variables are automatically set by the construct and typically don't need to be modified:\n\n#### `CDK_NEXTJS_BUILD_ID`\n\nUnique identifier for the Next.js build. Used for cache isolation between deployments.\n\n#### `CDK_NEXTJS_CACHE_BUCKET_NAME`\n\nS3 bucket name for storing cached data (optimized images, data cache, full route cache).\n\n#### `CDK_NEXTJS_REVALIDATION_TABLE_NAME`\n\nDynamoDB table name for tracking cache revalidations and tag-to-cache-key mappings.\n\n#### `DEBUG`\n\nSet to `cdk-nextjs:*` to set debug logs. This is especially useful to see cache handler activity.\n\n## Architecture\n\n### `NextjsGlobalFunctions`\n\nArchitecture includes [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) Functions to respond to dynamic requests and [CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html) Distribution to globally serve requests and distribute static assets. Use this construct when you have unpredictable traffic, can afford occasional latency (i.e. cold starts - [typically 1% of production traffic](https://aws.amazon.com/blogs/compute/operating-lambda-performance-optimization-part-1/)), and/or want the most granular pricing model. ([code](./src/root-constructs/nextjs-global-functions.ts))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service cloudfront(server)[CloudFront Distribution] in aws\n service s3static(disk)[S3 Static Assets] in aws\n service lambda(server)[Lambda Function] in aws\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:cloudfront\n cloudfront:R --> L:s3static\n cloudfront:R --> L:lambda\n lambda:R --> L:dynamodb\n lambda:R --> L:s3cache\n```\n\n### `NextjsGlobalContainers`\n\nArchitecture includes [ECS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) containers to respond to dynamic requests and [CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html) Distribution to globally serve requests and distribute static assets. Use this option when you have predictable traffic, need the lowest latency, and/or can afford a less granular pricing model. ([code](./src/root-constructs/nextjs-global-containers.ts))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group vpc[VPC] in aws\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service cloudfront(server)[CloudFront Distribution] in aws\n service s3static(disk)[S3 Static Assets] in aws\n service alb(server)[Application Load Balancer] in vpc\n service fargate(server)[ECS Fargate Containers] in vpc\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:cloudfront\n cloudfront:R --> L:s3static\n cloudfront:R --> L:alb\n alb:R --> L:fargate\n fargate:R --> L:dynamodb\n fargate:R --> L:s3cache\n```\n\n### `NextjsRegionalContainers`\n\nArchitecture includes [ECS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) containers to respond to dynamic requests and [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/) to regionally serve requests. Use this options when you cannot use Amazon CloudFront (i.e. [AWS GovCloud](https://aws.amazon.com/govcloud-us/?whats-new.sort-by=item.additionalFields.postDateTime&whats-new.sort-order=desc)). ([code](./src/root-constructs/nextjs-regional-containers.ts#L41))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group vpc[VPC] in aws\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service alb(server)[Application Load Balancer] in vpc\n service fargate(server)[ECS Fargate Containers] in vpc\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:alb\n alb:R --> L:fargate\n fargate:R --> L:dynamodb\n fargate:R --> L:s3cache\n```\n\n### `NextjsRegionalFunctions`\n\nArchitecture includes [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) Functions to respond to dynamic requests and [API Gateway REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html) to regionally serve requests and distribute static assets. Use this options when you cannot use Amazon CloudFront (i.e. [AWS GovCloud](https://aws.amazon.com/govcloud-us/?whats-new.sort-by=item.additionalFields.postDateTime&whats-new.sort-order=desc)). ([code](./src/root-constructs/nextjs-regional-functions.ts))\n\n```mermaid\narchitecture-beta\n group aws(cloud)[AWS Cloud]\n group cache[Cache Layer] in aws\n\n service user(internet)[User]\n service apigateway(server)[API Gateway REST API] in aws\n service s3static(disk)[S3 Static Assets] in aws\n service lambda(server)[Lambda Function] in aws\n service dynamodb(database)[DynamoDB Table] in cache\n service s3cache(disk)[S3 Cache Bucket] in cache\n\n user:R --> L:apigateway\n apigateway:R --> L:s3static\n apigateway:R --> L:lambda\n lambda:R --> L:dynamodb\n lambda:R --> L:s3cache\n```\n\n## Why\n\nThe simplest path to deploy Next.js is on [Vercel](https://vercel.com/) - the Platform-as-a-Service company behind Next.js. However, deploying to Vercel can be expensive and some developers want all of their workloads running _directly_ on AWS. Developers can deploy Next.js on AWS through [AWS Amplify Hosting](https://docs.aws.amazon.com/amplify/latest/userguide/ssr-Amplifysupport.html), but Amplify does not support all Next.js features and manages AWS resources for you so they cannot be customized. If Amplify meets your requirements we recommend you use it, but if you want to use all Next.js features or want more visibility into the AWS resources then this construct is for you.\n\n## Design Principles\n\n- Treat Next.js as black box. Minimize reliance on Next.js internal APIs to reduce chance of incompatibility between this construct and future versions of Next.js.\n- Security first.\n- One architecture does not fit all.\n- Enable customization everywhere.\n\n## Bring Your Own Resources\n\ncdk-nextjs supports importing existing AWS resources instead of creating new ones. This is especially useful for per-branch (MR/PR) environments where you deploy shared infrastructure once and spin up lightweight branch stacks that reuse it.\n\n### Supported Resources\n\n| Resource | Prop | Available On |\n| --------------------------- | -------------------- | ---------------------------------------------------- |\n| S3 Cache Bucket | `cacheBucket` | All constructs |\n| DynamoDB Revalidation Table | `revalidationTable` | All constructs |\n| S3 Static Assets Bucket | `staticAssetsBucket` | All constructs |\n| CloudFront Distribution | `distribution` | `NextjsGlobalFunctions`, `NextjsGlobalContainers` |\n| ECS Cluster | `ecsCluster` | `NextjsGlobalContainers`, `NextjsRegionalContainers` |\n| ALB | `alb` | `NextjsGlobalContainers`, `NextjsRegionalContainers` |\n\n### Resource Isolation\n\n- **Cache bucket and DynamoDB table** are isolated by `buildId` prefix. Multiple branches safely share one bucket/table with no conflicts.\n- **Static assets bucket** — Next.js includes content hashes in static asset filenames, so different branches deploying the same file will produce identical content. It's safe for branches to overwrite each other. If you're already using `basePath` for routing, assets will naturally be prefixed by it — `NextjsGlobalFunctions` and `NextjsGlobalContainers` read the `basePath` out of your Next.js build and use it as the S3 key prefix, since CloudFront serves assets from S3 by request path and the two can't differ. Set the `basePath` prop only if you want to be explicit about it; a value that disagrees with your app's fails at synth.\n\n### Shared ALB and `removeAutoCreatedListener()`\n\n`ApplicationLoadBalancedFargateService` always creates a listener on port 80 — there is no opt-out. When you import an ALB that already has a listener on that port, the duplicate causes a deployment failure. Since CDK doesn't expose a way to prevent this, `removeAutoCreatedListener()` surgically removes the generated CloudFormation resources: the `CfnListener`, its security group ingress rule, rebuilds the ECS service `DependsOn` without the deleted listener, and removes auto-created `CfnOutput` resources:\n\n```ts\nconst nextjs = new NextjsRegionalContainers(this, \"Nextjs\", {\n // ...\n alb: sharedAlb,\n ecsCluster: sharedCluster,\n});\nnextjs.nextjsContainers.removeAutoCreatedListener();\n```\n\n### Examples\n\nSee [examples/bring-your-own/](./examples/bring-your-own/) for a complete deployable example with shared infrastructure and per-branch host-header routing.\n\n## Preview Environments (Per-Branch Deployments)\n\ncdk-nextjs can deploy ephemeral preview environments per merge request (MR) or pull request (PR). The recommended approach uses subdomain-based routing (`pr-123.app.example.com`) so each preview environment runs the same Next.js build as production — no `basePath` configuration or separate builds required.\n\nSee [examples/bring-your-own/](./examples/bring-your-own/) for a fully deployable example using `NextjsRegionalContainers` with a shared ALB, ECS Cluster, S3 buckets, and DynamoDB table — connected via SSM Parameter Store.\n\n### Prerequisites\n\n- Wildcard DNS record: `*.app.example.com` → your routing layer (ALB, CloudFront, API Gateway)\n- Wildcard ACM certificate: `*.app.example.com`\n\n### Per-Architecture Recommendations\n\n#### `NextjsGlobalContainers` and `NextjsRegionalContainers` (ALB-based)\n\nSubdomain routing via ALB host-based listener rules. This is the fastest and simplest approach. For `NextjsGlobalContainers`, CloudFront forwards the `Host` header to the ALB origin, so the ALB handles all branch routing — no CloudFront changes needed per branch.\n\nSee [examples/bring-your-own/](./examples/bring-your-own/) for the full implementation.\n\n#### `NextjsRegionalFunctions` (API Gateway)\n\nSubdomain routing via API Gateway custom domain mappings.\n\n1. Deploy shared infrastructure once: S3 buckets, DynamoDB table\n2. Per branch, deploy a cdk-nextjs stack that imports shared resources and creates its own API Gateway\n3. Create an API Gateway custom domain (`pr-123.app.example.com`) mapped to the branch's API stage\n4. Tear down the branch stack on MR close\n\n#### `NextjsGlobalFunctions` (Lambda + CloudFront)\n\nRequires a separate cdk-nextjs stack per branch, each with its own CloudFront distribution. CloudFront cannot route to different Lambda Function URL origins based on the `Host` header — origin selection is determined by cache behavior path patterns, not request headers.\n\n1. Deploy shared infrastructure once: S3 buckets, DynamoDB table\n2. Per branch, deploy a full cdk-nextjs stack that imports shared resources (`cacheBucket`, `revalidationTable`, `staticAssetsBucket`) but creates its own CloudFront distribution and Lambda function\n3. Point `pr-123.app.example.com` DNS to the branch's CloudFront distribution\n4. Tear down the branch stack on MR close\n\nNote: CloudFront distributions take several minutes to create/update, so this architecture has the slowest preview environment spin-up time.\n\n## Limitations\n\n- If using `NextjsGlobalFunctions` or `NextjsGlobalContainers` (which use CloudFront), the number of top level files/directories cannot exceed 25, the max number of behaviors a CloudFront Distribution supports. We recommend you put all of your public assets into one top level directory (i.e. public/static) so you don't reach this limit. See [CloudFront Quotas](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html) for more information.\n- If using `NextjsGlobalFunctions`, when [revalidating data in Next.js](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#on-demand-revalidation) (i.e. [revalidatePath](https://nextjs.org/docs/app/api-reference/functions/revalidatePath)), the CloudFront Cache will still hold stale data. You'll need to use AWS SDK JS V3 [CreateInvalidationCommand](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudfront/Class/CreateInvalidationCommand/) to manually invalidate the path in CloudFront. See more [here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html).\n- If using `NextjsGlobalFunctions`, setting an Authorization header won't work by default because of Lambda Function URL with IAM Auth is already using the Authorization header. You can use the `AWS_LWA_AUTHORIZATION_SOURCE` environment variable of [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter) to set an alternative Authorization header in the client which will then be set to the Authorization header when it reaches your app.\n- `NextjsRegionalFunctions` streaming depends on whether your server Lambda supports response streaming (e.g. [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter)'s `AWS_LWA_INVOKE_MODE`) — override `overrides.nextjsApi.dynamicIntegrationProps.responseTransferMode` to `BUFFERED` if it doesn't, otherwise API Gateway returns a 500 for every request.\n- If using `NextjsRegionalFunctions` without a custom domain, API Gateway REST APIs require a [stage name](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-stages.html) (default: `/prod`) to be specified. This causes links to pages and static assets to break because they're not prefixed with the stage name. You can work around this issue by specifying [basePath](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath) in next.config.js as your stage name — leave the construct's `basePath` prop unset when you do, since API Gateway strips the stage before matching resources. Additionally, you'll need to add middleware logic to rewrite requests to include the stage name because API Gateway does not include the stage name in the path passed to Lambda. See [examples/app-playground/middleware.ts](./examples/app-playground/middleware.ts). Mapping a custom domain at the root avoids all of this — see [examples/regional-functions/README.md](./examples/regional-functions/README.md#with-a-custom-domain-no-stage-workarounds).\n\n## Additional Security Recommendations\n\nThis construct by default implements all AWS security best practices that a CDK construct library reasonably can considering cost and complexity. Below are additional security practices we recommend you implement within your CDK app. Please see them below:\n\n- [VPC Flow Logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html). See [examples/](./examples) for sample implementation.\n- [Scan ECR Images For Vulnerabilities](https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html).\n- For `NextjsGlobalFunctions` and `NextjsGlobalContainers`, [CloudFront Access Logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html). See [examples/](./examples) for sample implementation.\n- For `NextjsGlobalContainers` and `NextjsRegionalContainers`, use [ALB HTTPS Listener](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html)\n- If using `NextjsGlobalContainers` and `NextjsRegionalContainers`, enable `ReadonlyRootFilesystem`. This will remove ability to use Static On-Demand feature of Next.js so it's not enabled by default, but is recommended for security.\n\n## Estimated Costs\n\n### Assumptions\n\nThe following basic assumptions were used for a typical medium Next.js app. See [docs/usage.xlsx](./docs/usage.xlsx) for detailed assumptions and usage per construct type that you can plug into AWS Pricing Calculator.\n\n| Metric | Value |\n| ------------------------------------------------------------ | ----- |\n| Monthly Active Users | 1K |\n| Pages Visited Per Month Per User | 100 |\n| Avg Request Size | 50KB |\n| Static Requests Per Page (js, css, etc) | 15 |\n| Static Requests Cache Hit % | 50% |\n| Static Assets Size | 10GB |\n| Dynamic Requests Per Page (document, optimized images, etc.) | 5 |\n| Dynamic Cache Read % | 50% |\n| Dynamic Cache Write % | 5% |\n| Dynamic Cache Data Size | 10GB |\n| Average Dynamic Cache Request Size | 100KB |\n| Dynamic Revalidate Tag % | 1% |\n\nMore Details:\n\n- Assume ARM architecture for compute\n- AWS Region: us-east-1\n- Excludes charges related to: CloudWatch Logs, NAT Gateway data processing\n\n### NextjsGlobalFunctions\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=23611f6fea87ef05d5fe87c33135ddde43b17a98)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ---------- | ---------------------------------------------- | ---------------------------- |\n| Lambda | 500K requests, 2 GB memory, 150ms avg duration | $0.00 (Always Free Tier) |\n| CloudFront | 2M requests, 100 GB transfer to internet | $0.00 (Always Free Tier) |\n| S3 | 20 GB storage, 1M GET, 250K PUT requests | $2.11 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| Total | | $8.09 |\n\n### NextjsGlobalContainers\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=02f0073e612d1eee2a7ccace2c636adc5f0acab7)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ----------- | ---------------------------------------- | ---------------------------- |\n| ECS Fargate | 1 task (1 vCPU, 2 GB) | $28.44 |\n| ALB | 1 LB, 1.04GB/hr, 5.79 conn/sec | $22.50 |\n| CloudFront | 2M requests, 100 GB transfer to internet | $0.00 (Always Free Tier) |\n| S3 | 20 GB storage, 1M GET, 250K PUT requests | $2.11 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| VPC | NAT Gateway, 2 AZs | $65.70 |\n| Total | | $121.25 |\n\n### NextjsRegionalContainers\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=e214abe60eb4e24fc5866d07ef4355393261af3c)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ----------- | ------------------------------------------ | ---------------------------- |\n| ECS Fargate | 1 task (2 vCPU, 4 GB), always on | $28.44 |\n| ALB | 1 LB, 4.17 GB/hr, 23.15 conn/sec | $40.78 |\n| S3 | 10 GB storage, 250K GET, 250K PUT requests | $1.58 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| VPC | NAT Gateway, 2 AZs | $65.70 |\n| Total | | $139.00 |\n\n### NextjsRegionalFunctions\n\n[AWS Pricing Calculator](https://calculator.aws/#/estimate?id=60da38c7993c1baeee2fee4bd19ba6441608bb15)\n\n| Service | Monthly Usage | Estimated Monthly Cost (USD) |\n| ----------- | ---------------------------------------------- | ---------------------------- |\n| Lambda | 500K requests, 2 GB memory, 150ms avg duration | $0.00 (Always Free Tier) |\n| API Gateway | 2M requests | $7.00 |\n| S3 | 10 GB storage, 250K GET, 250K PUT requests | $1.58 |\n| DynamoDB | 10 GB storage, 5K Reads, 5K Writes | $2.50 |\n| Total | | $11.08 |\n\n## Performance\n\n[Artillery Playwright](https://www.artillery.io/docs/reference/engines/playwright#overview) app playground example load tests results with 1K concurrent users. Reproduce with `pnpm test-fargate:lg` within `examples/load-tests`.\n\n### NextjsGlobalFunctions\n\n<details>\n<summary>`NextjsGlobalFunctions` Performance Details</summary>\n\n```bash\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr:\n min: ......................................................................... 6.3\n max: ......................................................................... 5017.4\n mean: ........................................................................ 11.5\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 22.9\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr/1:\n min: ......................................................................... 3.2\n max: ......................................................................... 560.6\n mean: ........................................................................ 9.4\n median: ...................................................................... 5.4\n p95: ......................................................................... 11.1\n p99: ......................................................................... 162.4\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr/2:\n min: ......................................................................... 3.1\n max: ......................................................................... 1511.9\n mean: ........................................................................ 9.2\n median: ...................................................................... 5.2\n p95: ......................................................................... 10.7\n p99: ......................................................................... 149.9\nbrowser.page.TTFB.https://abc123.cloudfront.net/isr/3:\n min: ......................................................................... 3.4\n max: ......................................................................... 131.1\n mean: ........................................................................ 7.1\n median: ...................................................................... 5.3\n p95: ......................................................................... 10.1\n p99: ......................................................................... 64.7\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssg:\n min: ......................................................................... 6.4\n max: ......................................................................... 5015.1\n mean: ........................................................................ 11.5\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 23.3\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssg/3:\n min: ......................................................................... 2.9\n max: ......................................................................... 98\n mean: ........................................................................ 5.1\n median: ...................................................................... 4.6\n p95: ......................................................................... 8.2\n p99: ......................................................................... 12.8\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssr:\n min: ......................................................................... 6.4\n max: ......................................................................... 5018.6\n mean: ........................................................................ 11.3\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 23.3\nbrowser.page.TTFB.https://abc123.cloudfront.net/ssr/2:\n min: ......................................................................... 83.4\n max: ......................................................................... 150.7\n mean: ........................................................................ 119\n median: ...................................................................... 111.1\n p95: ......................................................................... 147\n p99: ......................................................................... 147\nbrowser.page.TTFB.https://abc123.cloudfront.net/streaming:\n min: ......................................................................... 6.4\n max: ......................................................................... 5015.2\n mean: ........................................................................ 11.8\n median: ...................................................................... 10.3\n p95: ......................................................................... 15.6\n p99: ......................................................................... 23.3\n```\n\n</details>\n\n\n\n### NextjsGlobalContainers\n\n<details>\n<summary>`NextjsGlobalContainers` Performance Details</summary>\n\n```bash\nTODO\n```\n\n</details>\n\n### NextjsRegionalContainers\n\n<details>\n<summary>`NextjsRegionalContainers` Performance Details</summary>\n\n```bash\nTODO\n```\n\n### NextjsRegionalFunctions\n\n<details>\n<summary>`NextjsRegionalFunctions` Performance Details</summary>\n\n```bash\nTODO\n```\n\n</details>\n\n## Guides\n\n- [Caching Guide](./docs/caching-guide.md)\n- [Pruning Guide](./docs/pruning-guide.md)\n- [Next Build Output Guide](./docs/next-build-output-guide.ts)\n- [Development Guide](./docs/development-guide.ts)\n\n## Contributing\n\nSteps to build locally:\n\n1. `git clone https://github.com/cdklabs/cdk-nextjs.git`\n2. `cd cdk-nextjs`\n3. `pnpm i && pnpm compile && pnpm build`\n\nThis project uses Projen, so make sure to not edit [Projen](https://projen.io/) created files and only edit .projenrc.ts.\n\n## FAQ\n\nQ: How does this compare to [cdk-nextjs-standalone](https://github.com/jetbridge/cdk-nextjs)?<br/>\nA: cdk-nextjs-standalone relies on [OpenNext](https://github.com/sst/open-next). OpenNext injects custom code to interact with private Next.js APIs. While OpenNext is able to make some optimizations that are great for serverless environments, this comes at an increase maintenance cost and increased chances for breaking changes. A goal of cdk-nextjs is to customize Next.js as little as possible to reduce the maintenance burden and decrease chances of breaking changes.\n\nQ: Why does cdk-nextjs depend upon Next.js v16.2 or higher?\nA: This version is required for [Image Optimization Caching](https://nextjs.org/docs/app/api-reference/config/next-config-js/incrementalCacheHandlerPath#image-optimization-caching) so that cdk-nextjs can depend upon public Next.js API.\n\nQ: How does cdk-nextjs support caching in Next.js?<br/>\nA: See [Caching Guide](./docs/caching-guide.md)\n\nQ: How customizable is the `cdk-nextjs` package for different use cases?<br/>\nA: The `cdk-nextjs` package offers deep customization through _prop-based_ overrides. These can be accessed in the construct props, allowing you to override settings like VPC configurations, CloudFront distribution, and ECS/Fargate setup. For example, you can modify `nextjsBuildProps` to customize the build process or use `nextjsDistributionProps` to adjust how CloudFront handles caching and routing. This level of control makes it easy to adapt the infrastructure to your application’s specific performance, networking, or deployment needs.\n\nQ: How can I use a custom domain with `cdk-nextjs`?<br/>\nA: See [low-cost example](./examples/low-cost/app.ts).\n\nQ: What is difference between `NextjsGlobalFunctionsProps.overrides.nextjsDistribution` and `NextjsGlobalFunctionsProps.overrides.nextjsGlobalFunctions.nextjsDistributionProps`<br/>\nA: `NextjsGlobalFunctionsProps.overrides.nextjsDistribution` allows you to customize any construct's props _within_ `NextjsDistribution` and is likely what you want whereas `NextjsGlobalFunctionsProps.overrides.nextjsGlobalFunctions.nextjsDistributionProps` allows you to customize the props passed into the construct: `NextjsDistribution`. This principle also applies to other similarly named overrides.\n\nQ: Why use container image for `NextjsGlobalFunctions`?<br />\nA: Read [The case for containers on Lambda (with benchmarks)](https://aaronstuyvenberg.com/posts/containers-on-lambda). Also, we depend upon [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter) to transform lambda event payloads into HTTP requests that Next.js expects.\n\nQ: How can I `cdk bootstrap --cloudformation-execution-policies ...` my AWS Account with limited permissions for cdk-nextjs to deploy?<br />\nA: See [docs/cdk-nextjs-cfn-exec-policy.json](./docs/cdk-nextjs-cfn-exec-policy.json). Note, this IAM Policy is scoped to all cdk-nextjs constructs so you can remove services if you know the construct you're using doesn't use that service.\n\n## Acknowledgements\n\nThis construct was built on the shoulders of giants. Thank you to the contributors of [cdk-nextjs-standalone](https://github.com/jetbridge/cdk-nextjs) and [open-next](https://github.com/sst/open-next).\n\n## 🥂 Thanks Contributors\n\nThank you for helping other developers deploy Next.js apps on AWS\n\n<a href=\"https://github.com/cdklabs/cdk-nextjs/graphs/contributors\">\n <img src=\"https://contrib.rocks/image?repo=cdklabs/cdk-nextjs\" />\n</a>\n"
|
|
9036
9036
|
},
|
|
9037
9037
|
"repository": {
|
|
9038
9038
|
"type": "git",
|
|
@@ -9059,7 +9059,7 @@
|
|
|
9059
9059
|
},
|
|
9060
9060
|
"locationInModule": {
|
|
9061
9061
|
"filename": "src/nextjs-api.ts",
|
|
9062
|
-
"line":
|
|
9062
|
+
"line": 127
|
|
9063
9063
|
},
|
|
9064
9064
|
"parameters": [
|
|
9065
9065
|
{
|
|
@@ -9085,7 +9085,7 @@
|
|
|
9085
9085
|
"kind": "class",
|
|
9086
9086
|
"locationInModule": {
|
|
9087
9087
|
"filename": "src/nextjs-api.ts",
|
|
9088
|
-
"line":
|
|
9088
|
+
"line": 91
|
|
9089
9089
|
},
|
|
9090
9090
|
"name": "NextjsApi",
|
|
9091
9091
|
"properties": [
|
|
@@ -9097,12 +9097,28 @@
|
|
|
9097
9097
|
"immutable": true,
|
|
9098
9098
|
"locationInModule": {
|
|
9099
9099
|
"filename": "src/nextjs-api.ts",
|
|
9100
|
-
"line":
|
|
9100
|
+
"line": 95
|
|
9101
9101
|
},
|
|
9102
9102
|
"name": "api",
|
|
9103
9103
|
"type": {
|
|
9104
9104
|
"fqn": "aws-cdk-lib.aws_apigateway.RestApi"
|
|
9105
9105
|
}
|
|
9106
|
+
},
|
|
9107
|
+
{
|
|
9108
|
+
"docs": {
|
|
9109
|
+
"remarks": "Prefers a custom domain configured through `overrides.restApiProps.domainName`\nover the execute-api endpoint.\n\nA domain attached after this construct is created (`api.addDomainName()`) is\nstill used for the host, but CDK keeps its base path mappings private, so a\nmapping added that way won't show up here.",
|
|
9110
|
+
"stability": "stable",
|
|
9111
|
+
"summary": "Public URL of the app, including every path segment the API nests it under."
|
|
9112
|
+
},
|
|
9113
|
+
"immutable": true,
|
|
9114
|
+
"locationInModule": {
|
|
9115
|
+
"filename": "src/nextjs-api.ts",
|
|
9116
|
+
"line": 106
|
|
9117
|
+
},
|
|
9118
|
+
"name": "url",
|
|
9119
|
+
"type": {
|
|
9120
|
+
"primitive": "string"
|
|
9121
|
+
}
|
|
9106
9122
|
}
|
|
9107
9123
|
],
|
|
9108
9124
|
"symbolId": "src/nextjs-api:NextjsApi"
|
|
@@ -9117,7 +9133,7 @@
|
|
|
9117
9133
|
"kind": "interface",
|
|
9118
9134
|
"locationInModule": {
|
|
9119
9135
|
"filename": "src/nextjs-api.ts",
|
|
9120
|
-
"line":
|
|
9136
|
+
"line": 28
|
|
9121
9137
|
},
|
|
9122
9138
|
"name": "NextjsApiOverrides",
|
|
9123
9139
|
"properties": [
|
|
@@ -9129,7 +9145,7 @@
|
|
|
9129
9145
|
"immutable": true,
|
|
9130
9146
|
"locationInModule": {
|
|
9131
9147
|
"filename": "src/nextjs-api.ts",
|
|
9132
|
-
"line":
|
|
9148
|
+
"line": 32
|
|
9133
9149
|
},
|
|
9134
9150
|
"name": "dynamicIntegrationProps",
|
|
9135
9151
|
"optional": true,
|
|
@@ -9145,7 +9161,7 @@
|
|
|
9145
9161
|
"immutable": true,
|
|
9146
9162
|
"locationInModule": {
|
|
9147
9163
|
"filename": "src/nextjs-api.ts",
|
|
9148
|
-
"line":
|
|
9164
|
+
"line": 33
|
|
9149
9165
|
},
|
|
9150
9166
|
"name": "imageIntegrationProps",
|
|
9151
9167
|
"optional": true,
|
|
@@ -9161,7 +9177,7 @@
|
|
|
9161
9177
|
"immutable": true,
|
|
9162
9178
|
"locationInModule": {
|
|
9163
9179
|
"filename": "src/nextjs-api.ts",
|
|
9164
|
-
"line":
|
|
9180
|
+
"line": 29
|
|
9165
9181
|
},
|
|
9166
9182
|
"name": "restApiProps",
|
|
9167
9183
|
"optional": true,
|
|
@@ -9177,7 +9193,7 @@
|
|
|
9177
9193
|
"immutable": true,
|
|
9178
9194
|
"locationInModule": {
|
|
9179
9195
|
"filename": "src/nextjs-api.ts",
|
|
9180
|
-
"line":
|
|
9196
|
+
"line": 31
|
|
9181
9197
|
},
|
|
9182
9198
|
"name": "s3MethodOptions",
|
|
9183
9199
|
"optional": true,
|
|
@@ -9193,7 +9209,7 @@
|
|
|
9193
9209
|
"immutable": true,
|
|
9194
9210
|
"locationInModule": {
|
|
9195
9211
|
"filename": "src/nextjs-api.ts",
|
|
9196
|
-
"line":
|
|
9212
|
+
"line": 30
|
|
9197
9213
|
},
|
|
9198
9214
|
"name": "staticIntegrationProps",
|
|
9199
9215
|
"optional": true,
|
|
@@ -9214,7 +9230,7 @@
|
|
|
9214
9230
|
"kind": "interface",
|
|
9215
9231
|
"locationInModule": {
|
|
9216
9232
|
"filename": "src/nextjs-api.ts",
|
|
9217
|
-
"line":
|
|
9233
|
+
"line": 36
|
|
9218
9234
|
},
|
|
9219
9235
|
"name": "NextjsApiProps",
|
|
9220
9236
|
"properties": [
|
|
@@ -9227,7 +9243,7 @@
|
|
|
9227
9243
|
"immutable": true,
|
|
9228
9244
|
"locationInModule": {
|
|
9229
9245
|
"filename": "src/nextjs-api.ts",
|
|
9230
|
-
"line":
|
|
9246
|
+
"line": 49
|
|
9231
9247
|
},
|
|
9232
9248
|
"name": "publicDirEntries",
|
|
9233
9249
|
"type": {
|
|
@@ -9248,7 +9264,7 @@
|
|
|
9248
9264
|
"immutable": true,
|
|
9249
9265
|
"locationInModule": {
|
|
9250
9266
|
"filename": "src/nextjs-api.ts",
|
|
9251
|
-
"line":
|
|
9267
|
+
"line": 70
|
|
9252
9268
|
},
|
|
9253
9269
|
"name": "staticAssetsBucket",
|
|
9254
9270
|
"type": {
|
|
@@ -9264,7 +9280,7 @@
|
|
|
9264
9280
|
"immutable": true,
|
|
9265
9281
|
"locationInModule": {
|
|
9266
9282
|
"filename": "src/nextjs-api.ts",
|
|
9267
|
-
"line":
|
|
9283
|
+
"line": 40
|
|
9268
9284
|
},
|
|
9269
9285
|
"name": "basePath",
|
|
9270
9286
|
"optional": true,
|
|
@@ -9282,7 +9298,7 @@
|
|
|
9282
9298
|
"immutable": true,
|
|
9283
9299
|
"locationInModule": {
|
|
9284
9300
|
"filename": "src/nextjs-api.ts",
|
|
9285
|
-
"line":
|
|
9301
|
+
"line": 66
|
|
9286
9302
|
},
|
|
9287
9303
|
"name": "imageFunction",
|
|
9288
9304
|
"optional": true,
|
|
@@ -9299,7 +9315,7 @@
|
|
|
9299
9315
|
"immutable": true,
|
|
9300
9316
|
"locationInModule": {
|
|
9301
9317
|
"filename": "src/nextjs-api.ts",
|
|
9302
|
-
"line":
|
|
9318
|
+
"line": 44
|
|
9303
9319
|
},
|
|
9304
9320
|
"name": "overrides",
|
|
9305
9321
|
"optional": true,
|
|
@@ -9317,7 +9333,7 @@
|
|
|
9317
9333
|
"immutable": true,
|
|
9318
9334
|
"locationInModule": {
|
|
9319
9335
|
"filename": "src/nextjs-api.ts",
|
|
9320
|
-
"line":
|
|
9336
|
+
"line": 53
|
|
9321
9337
|
},
|
|
9322
9338
|
"name": "serverFunction",
|
|
9323
9339
|
"optional": true,
|
|
@@ -9325,6 +9341,24 @@
|
|
|
9325
9341
|
"fqn": "aws-cdk-lib.aws_lambda.IFunction"
|
|
9326
9342
|
}
|
|
9327
9343
|
},
|
|
9344
|
+
{
|
|
9345
|
+
"abstract": true,
|
|
9346
|
+
"docs": {
|
|
9347
|
+
"remarks": "Independent of `basePath` above: that one is the URL prefix the REST API\nserves the app at (commonly the API Gateway stage), while this one is where\nthe objects live in the bucket. `_next/static` and public directory\nrequests are mapped to S3 keys directly, so they 404 unless this prefix is\napplied.",
|
|
9348
|
+
"stability": "stable",
|
|
9349
|
+
"summary": "S3 key prefix the static assets were uploaded under, i.e. `NextjsStaticAssets.keyPrefix`, which namespaces a shared bucket."
|
|
9350
|
+
},
|
|
9351
|
+
"immutable": true,
|
|
9352
|
+
"locationInModule": {
|
|
9353
|
+
"filename": "src/nextjs-api.ts",
|
|
9354
|
+
"line": 81
|
|
9355
|
+
},
|
|
9356
|
+
"name": "staticAssetsKeyPrefix",
|
|
9357
|
+
"optional": true,
|
|
9358
|
+
"type": {
|
|
9359
|
+
"primitive": "string"
|
|
9360
|
+
}
|
|
9361
|
+
},
|
|
9328
9362
|
{
|
|
9329
9363
|
"abstract": true,
|
|
9330
9364
|
"docs": {
|
|
@@ -9335,7 +9369,7 @@
|
|
|
9335
9369
|
"immutable": true,
|
|
9336
9370
|
"locationInModule": {
|
|
9337
9371
|
"filename": "src/nextjs-api.ts",
|
|
9338
|
-
"line":
|
|
9372
|
+
"line": 85
|
|
9339
9373
|
},
|
|
9340
9374
|
"name": "vpc",
|
|
9341
9375
|
"optional": true,
|
|
@@ -9361,7 +9395,7 @@
|
|
|
9361
9395
|
},
|
|
9362
9396
|
"locationInModule": {
|
|
9363
9397
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9364
|
-
"line":
|
|
9398
|
+
"line": 174
|
|
9365
9399
|
},
|
|
9366
9400
|
"parameters": [
|
|
9367
9401
|
{
|
|
@@ -9393,7 +9427,7 @@
|
|
|
9393
9427
|
"kind": "class",
|
|
9394
9428
|
"locationInModule": {
|
|
9395
9429
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9396
|
-
"line":
|
|
9430
|
+
"line": 153
|
|
9397
9431
|
},
|
|
9398
9432
|
"methods": [
|
|
9399
9433
|
{
|
|
@@ -9403,7 +9437,7 @@
|
|
|
9403
9437
|
},
|
|
9404
9438
|
"locationInModule": {
|
|
9405
9439
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9406
|
-
"line":
|
|
9440
|
+
"line": 250
|
|
9407
9441
|
},
|
|
9408
9442
|
"name": "computeBaseProps",
|
|
9409
9443
|
"protected": true,
|
|
@@ -9420,7 +9454,7 @@
|
|
|
9420
9454
|
},
|
|
9421
9455
|
"locationInModule": {
|
|
9422
9456
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9423
|
-
"line":
|
|
9457
|
+
"line": 297
|
|
9424
9458
|
},
|
|
9425
9459
|
"name": "createNextjsFunctions",
|
|
9426
9460
|
"parameters": [
|
|
@@ -9447,7 +9481,7 @@
|
|
|
9447
9481
|
},
|
|
9448
9482
|
"locationInModule": {
|
|
9449
9483
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9450
|
-
"line":
|
|
9484
|
+
"line": 320
|
|
9451
9485
|
},
|
|
9452
9486
|
"name": "createNextjsImageFunction",
|
|
9453
9487
|
"parameters": [
|
|
@@ -9476,7 +9510,7 @@
|
|
|
9476
9510
|
"immutable": true,
|
|
9477
9511
|
"locationInModule": {
|
|
9478
9512
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9479
|
-
"line":
|
|
9513
|
+
"line": 162
|
|
9480
9514
|
},
|
|
9481
9515
|
"name": "baseProps",
|
|
9482
9516
|
"protected": true,
|
|
@@ -9491,7 +9525,7 @@
|
|
|
9491
9525
|
"immutable": true,
|
|
9492
9526
|
"locationInModule": {
|
|
9493
9527
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9494
|
-
"line":
|
|
9528
|
+
"line": 160
|
|
9495
9529
|
},
|
|
9496
9530
|
"name": "nextjsType",
|
|
9497
9531
|
"protected": true,
|
|
@@ -9507,7 +9541,7 @@
|
|
|
9507
9541
|
"immutable": true,
|
|
9508
9542
|
"locationInModule": {
|
|
9509
9543
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9510
|
-
"line":
|
|
9544
|
+
"line": 158
|
|
9511
9545
|
},
|
|
9512
9546
|
"name": "url",
|
|
9513
9547
|
"type": {
|
|
@@ -9521,7 +9555,7 @@
|
|
|
9521
9555
|
"immutable": true,
|
|
9522
9556
|
"locationInModule": {
|
|
9523
9557
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9524
|
-
"line":
|
|
9558
|
+
"line": 165
|
|
9525
9559
|
},
|
|
9526
9560
|
"name": "constructOverrides",
|
|
9527
9561
|
"optional": true,
|
|
@@ -9530,13 +9564,31 @@
|
|
|
9530
9564
|
"fqn": "cdk-nextjs.NextjsFunctionsConstructOverrides"
|
|
9531
9565
|
}
|
|
9532
9566
|
},
|
|
9567
|
+
{
|
|
9568
|
+
"docs": {
|
|
9569
|
+
"remarks": "Normalized to a bare path segment, `undefined` for\nno `basePath`. Use this instead of `baseProps.basePath`.",
|
|
9570
|
+
"stability": "stable",
|
|
9571
|
+
"summary": "The `basePath` everything downstream is built from: the `basePath` prop when set, otherwise the app's own `basePath` for the `NextjsType`s where the two are necessarily the same."
|
|
9572
|
+
},
|
|
9573
|
+
"immutable": true,
|
|
9574
|
+
"locationInModule": {
|
|
9575
|
+
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9576
|
+
"line": 172
|
|
9577
|
+
},
|
|
9578
|
+
"name": "resolvedBasePath",
|
|
9579
|
+
"optional": true,
|
|
9580
|
+
"protected": true,
|
|
9581
|
+
"type": {
|
|
9582
|
+
"primitive": "string"
|
|
9583
|
+
}
|
|
9584
|
+
},
|
|
9533
9585
|
{
|
|
9534
9586
|
"docs": {
|
|
9535
9587
|
"stability": "stable"
|
|
9536
9588
|
},
|
|
9537
9589
|
"locationInModule": {
|
|
9538
9590
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9539
|
-
"line":
|
|
9591
|
+
"line": 154
|
|
9540
9592
|
},
|
|
9541
9593
|
"name": "nextjsBuild",
|
|
9542
9594
|
"type": {
|
|
@@ -9549,7 +9601,7 @@
|
|
|
9549
9601
|
},
|
|
9550
9602
|
"locationInModule": {
|
|
9551
9603
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9552
|
-
"line":
|
|
9604
|
+
"line": 156
|
|
9553
9605
|
},
|
|
9554
9606
|
"name": "nextjsCache",
|
|
9555
9607
|
"type": {
|
|
@@ -9562,7 +9614,7 @@
|
|
|
9562
9614
|
},
|
|
9563
9615
|
"locationInModule": {
|
|
9564
9616
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9565
|
-
"line":
|
|
9617
|
+
"line": 155
|
|
9566
9618
|
},
|
|
9567
9619
|
"name": "nextjsStaticAssets",
|
|
9568
9620
|
"type": {
|
|
@@ -9583,7 +9635,7 @@
|
|
|
9583
9635
|
"kind": "interface",
|
|
9584
9636
|
"locationInModule": {
|
|
9585
9637
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9586
|
-
"line":
|
|
9638
|
+
"line": 31
|
|
9587
9639
|
},
|
|
9588
9640
|
"name": "NextjsBaseConstructOverrides",
|
|
9589
9641
|
"properties": [
|
|
@@ -9595,7 +9647,7 @@
|
|
|
9595
9647
|
"immutable": true,
|
|
9596
9648
|
"locationInModule": {
|
|
9597
9649
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9598
|
-
"line":
|
|
9650
|
+
"line": 32
|
|
9599
9651
|
},
|
|
9600
9652
|
"name": "nextjsBuildProps",
|
|
9601
9653
|
"optional": true,
|
|
@@ -9611,7 +9663,7 @@
|
|
|
9611
9663
|
"immutable": true,
|
|
9612
9664
|
"locationInModule": {
|
|
9613
9665
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9614
|
-
"line":
|
|
9666
|
+
"line": 33
|
|
9615
9667
|
},
|
|
9616
9668
|
"name": "nextjsCacheProps",
|
|
9617
9669
|
"optional": true,
|
|
@@ -9627,7 +9679,7 @@
|
|
|
9627
9679
|
"immutable": true,
|
|
9628
9680
|
"locationInModule": {
|
|
9629
9681
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9630
|
-
"line":
|
|
9682
|
+
"line": 34
|
|
9631
9683
|
},
|
|
9632
9684
|
"name": "nextjsStaticAssetsProps",
|
|
9633
9685
|
"optional": true,
|
|
@@ -9652,7 +9704,7 @@
|
|
|
9652
9704
|
"kind": "interface",
|
|
9653
9705
|
"locationInModule": {
|
|
9654
9706
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9655
|
-
"line":
|
|
9707
|
+
"line": 146
|
|
9656
9708
|
},
|
|
9657
9709
|
"name": "NextjsBaseConstructProps",
|
|
9658
9710
|
"properties": [
|
|
@@ -9664,7 +9716,7 @@
|
|
|
9664
9716
|
"immutable": true,
|
|
9665
9717
|
"locationInModule": {
|
|
9666
9718
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9667
|
-
"line":
|
|
9719
|
+
"line": 147
|
|
9668
9720
|
},
|
|
9669
9721
|
"name": "overrides",
|
|
9670
9722
|
"optional": true,
|
|
@@ -9686,7 +9738,7 @@
|
|
|
9686
9738
|
"kind": "interface",
|
|
9687
9739
|
"locationInModule": {
|
|
9688
9740
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9689
|
-
"line":
|
|
9741
|
+
"line": 50
|
|
9690
9742
|
},
|
|
9691
9743
|
"name": "NextjsBaseOverrides",
|
|
9692
9744
|
"properties": [
|
|
@@ -9698,7 +9750,7 @@
|
|
|
9698
9750
|
"immutable": true,
|
|
9699
9751
|
"locationInModule": {
|
|
9700
9752
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9701
|
-
"line":
|
|
9753
|
+
"line": 51
|
|
9702
9754
|
},
|
|
9703
9755
|
"name": "nextjsCache",
|
|
9704
9756
|
"optional": true,
|
|
@@ -9714,7 +9766,7 @@
|
|
|
9714
9766
|
"immutable": true,
|
|
9715
9767
|
"locationInModule": {
|
|
9716
9768
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9717
|
-
"line":
|
|
9769
|
+
"line": 52
|
|
9718
9770
|
},
|
|
9719
9771
|
"name": "nextjsStaticAssets",
|
|
9720
9772
|
"optional": true,
|
|
@@ -9735,7 +9787,7 @@
|
|
|
9735
9787
|
"kind": "interface",
|
|
9736
9788
|
"locationInModule": {
|
|
9737
9789
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9738
|
-
"line":
|
|
9790
|
+
"line": 55
|
|
9739
9791
|
},
|
|
9740
9792
|
"name": "NextjsBaseProps",
|
|
9741
9793
|
"properties": [
|
|
@@ -9749,7 +9801,7 @@
|
|
|
9749
9801
|
"immutable": true,
|
|
9750
9802
|
"locationInModule": {
|
|
9751
9803
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9752
|
-
"line":
|
|
9804
|
+
"line": 93
|
|
9753
9805
|
},
|
|
9754
9806
|
"name": "buildDirectory",
|
|
9755
9807
|
"type": {
|
|
@@ -9766,7 +9818,7 @@
|
|
|
9766
9818
|
"immutable": true,
|
|
9767
9819
|
"locationInModule": {
|
|
9768
9820
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9769
|
-
"line":
|
|
9821
|
+
"line": 111
|
|
9770
9822
|
},
|
|
9771
9823
|
"name": "healthCheckPath",
|
|
9772
9824
|
"type": {
|
|
@@ -9777,13 +9829,14 @@
|
|
|
9777
9829
|
"abstract": true,
|
|
9778
9830
|
"docs": {
|
|
9779
9831
|
"example": "\"/my-base-path\"",
|
|
9832
|
+
"remarks": "Also namespaces the\nstatic assets in S3, so it doubles as a way to host multiple apps or\nbranches out of one bucket.\n\nHow this relates to the `basePath` in your app's `next.config.js` depends\non the construct, and synth fails on a combination that can't serve the\napp:\n\n- `NextjsGlobalFunctions`/`NextjsGlobalContainers`: leave this unset and it\n follows your app's `basePath`, which is what you want — CloudFront serves\n static assets from S3 using the request path as the object key, so the two\n have to be identical and a mismatch 404s all of them. Setting a different\n value throws.\n- `NextjsRegionalFunctions`: if you set this, the app's `basePath` must end\n with it — either equal to it, or prefixed by the stage or base path\n mapping API Gateway strips before matching resources (`basePath:\n \"/prod/base\"` with this set to `\"/base\"`). Leaving it unset while the app\n sets one is correct and common — an app served at the default `prod` stage\n sets `basePath: \"/prod\"` and leaves this alone.\n- `NextjsRegionalContainers`: only namespaces the S3 bucket. The ALB sends\n every path to the container, which serves its own static assets, so this\n is unconstrained.",
|
|
9780
9833
|
"stability": "stable",
|
|
9781
9834
|
"summary": "Prefix to the URI path the app will be served at."
|
|
9782
9835
|
},
|
|
9783
9836
|
"immutable": true,
|
|
9784
9837
|
"locationInModule": {
|
|
9785
9838
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9786
|
-
"line":
|
|
9839
|
+
"line": 81
|
|
9787
9840
|
},
|
|
9788
9841
|
"name": "basePath",
|
|
9789
9842
|
"optional": true,
|
|
@@ -9801,7 +9854,7 @@
|
|
|
9801
9854
|
"immutable": true,
|
|
9802
9855
|
"locationInModule": {
|
|
9803
9856
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9804
|
-
"line":
|
|
9857
|
+
"line": 86
|
|
9805
9858
|
},
|
|
9806
9859
|
"name": "buildCommand",
|
|
9807
9860
|
"optional": true,
|
|
@@ -9819,7 +9872,7 @@
|
|
|
9819
9872
|
"immutable": true,
|
|
9820
9873
|
"locationInModule": {
|
|
9821
9874
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9822
|
-
"line":
|
|
9875
|
+
"line": 99
|
|
9823
9876
|
},
|
|
9824
9877
|
"name": "cacheBucket",
|
|
9825
9878
|
"optional": true,
|
|
@@ -9837,7 +9890,7 @@
|
|
|
9837
9890
|
"immutable": true,
|
|
9838
9891
|
"locationInModule": {
|
|
9839
9892
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9840
|
-
"line":
|
|
9893
|
+
"line": 119
|
|
9841
9894
|
},
|
|
9842
9895
|
"name": "revalidationTable",
|
|
9843
9896
|
"optional": true,
|
|
@@ -9856,7 +9909,7 @@
|
|
|
9856
9909
|
"immutable": true,
|
|
9857
9910
|
"locationInModule": {
|
|
9858
9911
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9859
|
-
"line":
|
|
9912
|
+
"line": 125
|
|
9860
9913
|
},
|
|
9861
9914
|
"name": "skipBuild",
|
|
9862
9915
|
"optional": true,
|
|
@@ -9874,7 +9927,7 @@
|
|
|
9874
9927
|
"immutable": true,
|
|
9875
9928
|
"locationInModule": {
|
|
9876
9929
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9877
|
-
"line":
|
|
9930
|
+
"line": 131
|
|
9878
9931
|
},
|
|
9879
9932
|
"name": "staticAssetsBucket",
|
|
9880
9933
|
"optional": true,
|
|
@@ -9892,7 +9945,7 @@
|
|
|
9892
9945
|
"immutable": true,
|
|
9893
9946
|
"locationInModule": {
|
|
9894
9947
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
9895
|
-
"line":
|
|
9948
|
+
"line": 139
|
|
9896
9949
|
},
|
|
9897
9950
|
"name": "vpc",
|
|
9898
9951
|
"optional": true,
|
|
@@ -9920,7 +9973,7 @@
|
|
|
9920
9973
|
},
|
|
9921
9974
|
"locationInModule": {
|
|
9922
9975
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
9923
|
-
"line":
|
|
9976
|
+
"line": 108
|
|
9924
9977
|
},
|
|
9925
9978
|
"parameters": [
|
|
9926
9979
|
{
|
|
@@ -9946,7 +9999,7 @@
|
|
|
9946
9999
|
"kind": "class",
|
|
9947
10000
|
"locationInModule": {
|
|
9948
10001
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
9949
|
-
"line":
|
|
10002
|
+
"line": 54
|
|
9950
10003
|
},
|
|
9951
10004
|
"name": "NextjsBuild",
|
|
9952
10005
|
"properties": [
|
|
@@ -9957,7 +10010,7 @@
|
|
|
9957
10010
|
},
|
|
9958
10011
|
"locationInModule": {
|
|
9959
10012
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
9960
|
-
"line":
|
|
10013
|
+
"line": 59
|
|
9961
10014
|
},
|
|
9962
10015
|
"name": "buildId",
|
|
9963
10016
|
"type": {
|
|
@@ -9971,7 +10024,7 @@
|
|
|
9971
10024
|
},
|
|
9972
10025
|
"locationInModule": {
|
|
9973
10026
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
9974
|
-
"line":
|
|
10027
|
+
"line": 87
|
|
9975
10028
|
},
|
|
9976
10029
|
"name": "dotNextPath",
|
|
9977
10030
|
"type": {
|
|
@@ -9986,13 +10039,27 @@
|
|
|
9986
10039
|
},
|
|
9987
10040
|
"locationInModule": {
|
|
9988
10041
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
9989
|
-
"line":
|
|
10042
|
+
"line": 64
|
|
9990
10043
|
},
|
|
9991
10044
|
"name": "initCacheDir",
|
|
9992
10045
|
"type": {
|
|
9993
10046
|
"primitive": "string"
|
|
9994
10047
|
}
|
|
9995
10048
|
},
|
|
10049
|
+
{
|
|
10050
|
+
"docs": {
|
|
10051
|
+
"stability": "stable",
|
|
10052
|
+
"summary": "The Next.js app's own `basePath` — the URL prefix it generates its links and asset hrefs under — read out of the build's `required-server-files.json`. Normalized to a bare path segment, empty when the app sets none. Exposed so root constructs can reconcile it with the CDK `basePath` prop, which is a distinct thing; see `resolveBasePath`."
|
|
10053
|
+
},
|
|
10054
|
+
"locationInModule": {
|
|
10055
|
+
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10056
|
+
"line": 95
|
|
10057
|
+
},
|
|
10058
|
+
"name": "nextConfigBasePath",
|
|
10059
|
+
"type": {
|
|
10060
|
+
"primitive": "string"
|
|
10061
|
+
}
|
|
10062
|
+
},
|
|
9996
10063
|
{
|
|
9997
10064
|
"docs": {
|
|
9998
10065
|
"example": "\"/Users/john/myapp/public\"",
|
|
@@ -10002,7 +10069,7 @@
|
|
|
10002
10069
|
},
|
|
10003
10070
|
"locationInModule": {
|
|
10004
10071
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10005
|
-
"line":
|
|
10072
|
+
"line": 69
|
|
10006
10073
|
},
|
|
10007
10074
|
"name": "publicDirEntries",
|
|
10008
10075
|
"type": {
|
|
@@ -10022,7 +10089,7 @@
|
|
|
10022
10089
|
},
|
|
10023
10090
|
"locationInModule": {
|
|
10024
10091
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10025
|
-
"line":
|
|
10092
|
+
"line": 76
|
|
10026
10093
|
},
|
|
10027
10094
|
"name": "relativePathToEntrypoint",
|
|
10028
10095
|
"type": {
|
|
@@ -10037,7 +10104,7 @@
|
|
|
10037
10104
|
},
|
|
10038
10105
|
"locationInModule": {
|
|
10039
10106
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10040
|
-
"line":
|
|
10107
|
+
"line": 83
|
|
10041
10108
|
},
|
|
10042
10109
|
"name": "relativePathToPackage",
|
|
10043
10110
|
"type": {
|
|
@@ -10051,7 +10118,7 @@
|
|
|
10051
10118
|
},
|
|
10052
10119
|
"locationInModule": {
|
|
10053
10120
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10054
|
-
"line":
|
|
10121
|
+
"line": 103
|
|
10055
10122
|
},
|
|
10056
10123
|
"name": "imageOptimizationAssetPath",
|
|
10057
10124
|
"optional": true,
|
|
@@ -10072,7 +10139,7 @@
|
|
|
10072
10139
|
"kind": "interface",
|
|
10073
10140
|
"locationInModule": {
|
|
10074
10141
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10075
|
-
"line":
|
|
10142
|
+
"line": 28
|
|
10076
10143
|
},
|
|
10077
10144
|
"name": "NextjsBuildProps",
|
|
10078
10145
|
"properties": [
|
|
@@ -10085,7 +10152,7 @@
|
|
|
10085
10152
|
"immutable": true,
|
|
10086
10153
|
"locationInModule": {
|
|
10087
10154
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10088
|
-
"line":
|
|
10155
|
+
"line": 37
|
|
10089
10156
|
},
|
|
10090
10157
|
"name": "buildDirectory",
|
|
10091
10158
|
"type": {
|
|
@@ -10100,7 +10167,7 @@
|
|
|
10100
10167
|
"immutable": true,
|
|
10101
10168
|
"locationInModule": {
|
|
10102
10169
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10103
|
-
"line":
|
|
10170
|
+
"line": 38
|
|
10104
10171
|
},
|
|
10105
10172
|
"name": "nextjsType",
|
|
10106
10173
|
"type": {
|
|
@@ -10116,7 +10183,7 @@
|
|
|
10116
10183
|
"immutable": true,
|
|
10117
10184
|
"locationInModule": {
|
|
10118
10185
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10119
|
-
"line":
|
|
10186
|
+
"line": 32
|
|
10120
10187
|
},
|
|
10121
10188
|
"name": "buildCommand",
|
|
10122
10189
|
"optional": true,
|
|
@@ -10133,7 +10200,7 @@
|
|
|
10133
10200
|
"immutable": true,
|
|
10134
10201
|
"locationInModule": {
|
|
10135
10202
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
10136
|
-
"line":
|
|
10203
|
+
"line": 42
|
|
10137
10204
|
},
|
|
10138
10205
|
"name": "skipBuild",
|
|
10139
10206
|
"optional": true,
|
|
@@ -10836,7 +10903,7 @@
|
|
|
10836
10903
|
},
|
|
10837
10904
|
"locationInModule": {
|
|
10838
10905
|
"filename": "src/nextjs-distribution.ts",
|
|
10839
|
-
"line":
|
|
10906
|
+
"line": 152
|
|
10840
10907
|
},
|
|
10841
10908
|
"parameters": [
|
|
10842
10909
|
{
|
|
@@ -10862,7 +10929,7 @@
|
|
|
10862
10929
|
"kind": "class",
|
|
10863
10930
|
"locationInModule": {
|
|
10864
10931
|
"filename": "src/nextjs-distribution.ts",
|
|
10865
|
-
"line":
|
|
10932
|
+
"line": 108
|
|
10866
10933
|
},
|
|
10867
10934
|
"name": "NextjsDistribution",
|
|
10868
10935
|
"properties": [
|
|
@@ -10872,7 +10939,7 @@
|
|
|
10872
10939
|
},
|
|
10873
10940
|
"locationInModule": {
|
|
10874
10941
|
"filename": "src/nextjs-distribution.ts",
|
|
10875
|
-
"line":
|
|
10942
|
+
"line": 109
|
|
10876
10943
|
},
|
|
10877
10944
|
"name": "distribution",
|
|
10878
10945
|
"type": {
|
|
@@ -10892,7 +10959,7 @@
|
|
|
10892
10959
|
"kind": "interface",
|
|
10893
10960
|
"locationInModule": {
|
|
10894
10961
|
"filename": "src/nextjs-distribution.ts",
|
|
10895
|
-
"line":
|
|
10962
|
+
"line": 48
|
|
10896
10963
|
},
|
|
10897
10964
|
"name": "NextjsDistributionOverrides",
|
|
10898
10965
|
"properties": [
|
|
@@ -10904,7 +10971,7 @@
|
|
|
10904
10971
|
"immutable": true,
|
|
10905
10972
|
"locationInModule": {
|
|
10906
10973
|
"filename": "src/nextjs-distribution.ts",
|
|
10907
|
-
"line":
|
|
10974
|
+
"line": 49
|
|
10908
10975
|
},
|
|
10909
10976
|
"name": "distributionProps",
|
|
10910
10977
|
"optional": true,
|
|
@@ -10920,7 +10987,7 @@
|
|
|
10920
10987
|
"immutable": true,
|
|
10921
10988
|
"locationInModule": {
|
|
10922
10989
|
"filename": "src/nextjs-distribution.ts",
|
|
10923
|
-
"line":
|
|
10990
|
+
"line": 53
|
|
10924
10991
|
},
|
|
10925
10992
|
"name": "dynamicBehaviorOptions",
|
|
10926
10993
|
"optional": true,
|
|
@@ -10936,7 +11003,7 @@
|
|
|
10936
11003
|
"immutable": true,
|
|
10937
11004
|
"locationInModule": {
|
|
10938
11005
|
"filename": "src/nextjs-distribution.ts",
|
|
10939
|
-
"line":
|
|
11006
|
+
"line": 54
|
|
10940
11007
|
},
|
|
10941
11008
|
"name": "dynamicCachePolicyProps",
|
|
10942
11009
|
"optional": true,
|
|
@@ -10952,7 +11019,7 @@
|
|
|
10952
11019
|
"immutable": true,
|
|
10953
11020
|
"locationInModule": {
|
|
10954
11021
|
"filename": "src/nextjs-distribution.ts",
|
|
10955
|
-
"line":
|
|
11022
|
+
"line": 56
|
|
10956
11023
|
},
|
|
10957
11024
|
"name": "dynamicFunctionUrlOriginWithOACProps",
|
|
10958
11025
|
"optional": true,
|
|
@@ -10968,7 +11035,7 @@
|
|
|
10968
11035
|
"immutable": true,
|
|
10969
11036
|
"locationInModule": {
|
|
10970
11037
|
"filename": "src/nextjs-distribution.ts",
|
|
10971
|
-
"line":
|
|
11038
|
+
"line": 55
|
|
10972
11039
|
},
|
|
10973
11040
|
"name": "dynamicResponseHeadersPolicyProps",
|
|
10974
11041
|
"optional": true,
|
|
@@ -10984,7 +11051,7 @@
|
|
|
10984
11051
|
"immutable": true,
|
|
10985
11052
|
"locationInModule": {
|
|
10986
11053
|
"filename": "src/nextjs-distribution.ts",
|
|
10987
|
-
"line":
|
|
11054
|
+
"line": 57
|
|
10988
11055
|
},
|
|
10989
11056
|
"name": "dynamicVpcOriginWithEndpointProps",
|
|
10990
11057
|
"optional": true,
|
|
@@ -11000,7 +11067,7 @@
|
|
|
11000
11067
|
"immutable": true,
|
|
11001
11068
|
"locationInModule": {
|
|
11002
11069
|
"filename": "src/nextjs-distribution.ts",
|
|
11003
|
-
"line":
|
|
11070
|
+
"line": 50
|
|
11004
11071
|
},
|
|
11005
11072
|
"name": "imageBehaviorOptions",
|
|
11006
11073
|
"optional": true,
|
|
@@ -11016,7 +11083,7 @@
|
|
|
11016
11083
|
"immutable": true,
|
|
11017
11084
|
"locationInModule": {
|
|
11018
11085
|
"filename": "src/nextjs-distribution.ts",
|
|
11019
|
-
"line":
|
|
11086
|
+
"line": 51
|
|
11020
11087
|
},
|
|
11021
11088
|
"name": "imageCachePolicyProps",
|
|
11022
11089
|
"optional": true,
|
|
@@ -11032,7 +11099,7 @@
|
|
|
11032
11099
|
"immutable": true,
|
|
11033
11100
|
"locationInModule": {
|
|
11034
11101
|
"filename": "src/nextjs-distribution.ts",
|
|
11035
|
-
"line":
|
|
11102
|
+
"line": 58
|
|
11036
11103
|
},
|
|
11037
11104
|
"name": "imageFunctionUrlOriginWithOACProps",
|
|
11038
11105
|
"optional": true,
|
|
@@ -11048,7 +11115,7 @@
|
|
|
11048
11115
|
"immutable": true,
|
|
11049
11116
|
"locationInModule": {
|
|
11050
11117
|
"filename": "src/nextjs-distribution.ts",
|
|
11051
|
-
"line":
|
|
11118
|
+
"line": 52
|
|
11052
11119
|
},
|
|
11053
11120
|
"name": "imageResponseHeadersPolicyProps",
|
|
11054
11121
|
"optional": true,
|
|
@@ -11064,7 +11131,7 @@
|
|
|
11064
11131
|
"immutable": true,
|
|
11065
11132
|
"locationInModule": {
|
|
11066
11133
|
"filename": "src/nextjs-distribution.ts",
|
|
11067
|
-
"line":
|
|
11134
|
+
"line": 61
|
|
11068
11135
|
},
|
|
11069
11136
|
"name": "s3BucketOriginProps",
|
|
11070
11137
|
"optional": true,
|
|
@@ -11080,7 +11147,7 @@
|
|
|
11080
11147
|
"immutable": true,
|
|
11081
11148
|
"locationInModule": {
|
|
11082
11149
|
"filename": "src/nextjs-distribution.ts",
|
|
11083
|
-
"line":
|
|
11150
|
+
"line": 59
|
|
11084
11151
|
},
|
|
11085
11152
|
"name": "staticBehaviorOptions",
|
|
11086
11153
|
"optional": true,
|
|
@@ -11096,7 +11163,7 @@
|
|
|
11096
11163
|
"immutable": true,
|
|
11097
11164
|
"locationInModule": {
|
|
11098
11165
|
"filename": "src/nextjs-distribution.ts",
|
|
11099
|
-
"line":
|
|
11166
|
+
"line": 60
|
|
11100
11167
|
},
|
|
11101
11168
|
"name": "staticResponseHeadersPolicyProps",
|
|
11102
11169
|
"optional": true,
|
|
@@ -11117,7 +11184,7 @@
|
|
|
11117
11184
|
"kind": "interface",
|
|
11118
11185
|
"locationInModule": {
|
|
11119
11186
|
"filename": "src/nextjs-distribution.ts",
|
|
11120
|
-
"line":
|
|
11187
|
+
"line": 64
|
|
11121
11188
|
},
|
|
11122
11189
|
"name": "NextjsDistributionProps",
|
|
11123
11190
|
"properties": [
|
|
@@ -11131,7 +11198,7 @@
|
|
|
11131
11198
|
"immutable": true,
|
|
11132
11199
|
"locationInModule": {
|
|
11133
11200
|
"filename": "src/nextjs-distribution.ts",
|
|
11134
|
-
"line":
|
|
11201
|
+
"line": 69
|
|
11135
11202
|
},
|
|
11136
11203
|
"name": "assetsBucket",
|
|
11137
11204
|
"type": {
|
|
@@ -11146,7 +11213,7 @@
|
|
|
11146
11213
|
"immutable": true,
|
|
11147
11214
|
"locationInModule": {
|
|
11148
11215
|
"filename": "src/nextjs-distribution.ts",
|
|
11149
|
-
"line":
|
|
11216
|
+
"line": 96
|
|
11150
11217
|
},
|
|
11151
11218
|
"name": "nextjsType",
|
|
11152
11219
|
"type": {
|
|
@@ -11162,7 +11229,7 @@
|
|
|
11162
11229
|
"immutable": true,
|
|
11163
11230
|
"locationInModule": {
|
|
11164
11231
|
"filename": "src/nextjs-distribution.ts",
|
|
11165
|
-
"line":
|
|
11232
|
+
"line": 105
|
|
11166
11233
|
},
|
|
11167
11234
|
"name": "publicDirEntries",
|
|
11168
11235
|
"type": {
|
|
@@ -11177,12 +11244,14 @@
|
|
|
11177
11244
|
{
|
|
11178
11245
|
"abstract": true,
|
|
11179
11246
|
"docs": {
|
|
11180
|
-
"
|
|
11247
|
+
"remarks": "Surrounding slashes are normalized\naway, so \"/base\", \"base\" and \"/base/\" all produce the same cache behaviors.",
|
|
11248
|
+
"stability": "stable",
|
|
11249
|
+
"summary": "URI path prefix the app is served at."
|
|
11181
11250
|
},
|
|
11182
11251
|
"immutable": true,
|
|
11183
11252
|
"locationInModule": {
|
|
11184
11253
|
"filename": "src/nextjs-distribution.ts",
|
|
11185
|
-
"line":
|
|
11254
|
+
"line": 74
|
|
11186
11255
|
},
|
|
11187
11256
|
"name": "basePath",
|
|
11188
11257
|
"optional": true,
|
|
@@ -11199,7 +11268,7 @@
|
|
|
11199
11268
|
"immutable": true,
|
|
11200
11269
|
"locationInModule": {
|
|
11201
11270
|
"filename": "src/nextjs-distribution.ts",
|
|
11202
|
-
"line":
|
|
11271
|
+
"line": 78
|
|
11203
11272
|
},
|
|
11204
11273
|
"name": "certificate",
|
|
11205
11274
|
"optional": true,
|
|
@@ -11215,7 +11284,7 @@
|
|
|
11215
11284
|
"immutable": true,
|
|
11216
11285
|
"locationInModule": {
|
|
11217
11286
|
"filename": "src/nextjs-distribution.ts",
|
|
11218
|
-
"line":
|
|
11287
|
+
"line": 79
|
|
11219
11288
|
},
|
|
11220
11289
|
"name": "distribution",
|
|
11221
11290
|
"optional": true,
|
|
@@ -11232,7 +11301,7 @@
|
|
|
11232
11301
|
"immutable": true,
|
|
11233
11302
|
"locationInModule": {
|
|
11234
11303
|
"filename": "src/nextjs-distribution.ts",
|
|
11235
|
-
"line":
|
|
11304
|
+
"line": 83
|
|
11236
11305
|
},
|
|
11237
11306
|
"name": "functionUrl",
|
|
11238
11307
|
"optional": true,
|
|
@@ -11250,7 +11319,7 @@
|
|
|
11250
11319
|
"immutable": true,
|
|
11251
11320
|
"locationInModule": {
|
|
11252
11321
|
"filename": "src/nextjs-distribution.ts",
|
|
11253
|
-
"line":
|
|
11322
|
+
"line": 91
|
|
11254
11323
|
},
|
|
11255
11324
|
"name": "imageFunctionUrl",
|
|
11256
11325
|
"optional": true,
|
|
@@ -11267,7 +11336,7 @@
|
|
|
11267
11336
|
"immutable": true,
|
|
11268
11337
|
"locationInModule": {
|
|
11269
11338
|
"filename": "src/nextjs-distribution.ts",
|
|
11270
|
-
"line":
|
|
11339
|
+
"line": 95
|
|
11271
11340
|
},
|
|
11272
11341
|
"name": "loadBalancer",
|
|
11273
11342
|
"optional": true,
|
|
@@ -11284,7 +11353,7 @@
|
|
|
11284
11353
|
"immutable": true,
|
|
11285
11354
|
"locationInModule": {
|
|
11286
11355
|
"filename": "src/nextjs-distribution.ts",
|
|
11287
|
-
"line":
|
|
11356
|
+
"line": 100
|
|
11288
11357
|
},
|
|
11289
11358
|
"name": "overrides",
|
|
11290
11359
|
"optional": true,
|
|
@@ -11384,7 +11453,7 @@
|
|
|
11384
11453
|
"kind": "interface",
|
|
11385
11454
|
"locationInModule": {
|
|
11386
11455
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
11387
|
-
"line":
|
|
11456
|
+
"line": 42
|
|
11388
11457
|
},
|
|
11389
11458
|
"name": "NextjsFunctionsConstructOverrides",
|
|
11390
11459
|
"properties": [
|
|
@@ -11396,7 +11465,7 @@
|
|
|
11396
11465
|
"immutable": true,
|
|
11397
11466
|
"locationInModule": {
|
|
11398
11467
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
11399
|
-
"line":
|
|
11468
|
+
"line": 43
|
|
11400
11469
|
},
|
|
11401
11470
|
"name": "nextjsFunctionsProps",
|
|
11402
11471
|
"optional": true,
|
|
@@ -11412,7 +11481,7 @@
|
|
|
11412
11481
|
"immutable": true,
|
|
11413
11482
|
"locationInModule": {
|
|
11414
11483
|
"filename": "src/root-constructs/nextjs-base-construct.ts",
|
|
11415
|
-
"line":
|
|
11484
|
+
"line": 44
|
|
11416
11485
|
},
|
|
11417
11486
|
"name": "nextjsImageFunctionProps",
|
|
11418
11487
|
"optional": true,
|
|
@@ -11538,7 +11607,7 @@
|
|
|
11538
11607
|
},
|
|
11539
11608
|
"locationInModule": {
|
|
11540
11609
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11541
|
-
"line":
|
|
11610
|
+
"line": 98
|
|
11542
11611
|
},
|
|
11543
11612
|
"parameters": [
|
|
11544
11613
|
{
|
|
@@ -11564,18 +11633,19 @@
|
|
|
11564
11633
|
"kind": "class",
|
|
11565
11634
|
"locationInModule": {
|
|
11566
11635
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11567
|
-
"line":
|
|
11636
|
+
"line": 80
|
|
11568
11637
|
},
|
|
11569
11638
|
"name": "NextjsGlobalContainers",
|
|
11570
11639
|
"properties": [
|
|
11571
11640
|
{
|
|
11572
11641
|
"docs": {
|
|
11573
|
-
"stability": "stable"
|
|
11642
|
+
"stability": "stable",
|
|
11643
|
+
"summary": "Public URL of the app, including `basePath` — the app only answers under that prefix, and it's derived from the app's own `basePath` when the prop is left unset, so it's there whether or not you asked for it."
|
|
11574
11644
|
},
|
|
11575
11645
|
"immutable": true,
|
|
11576
11646
|
"locationInModule": {
|
|
11577
11647
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11578
|
-
"line":
|
|
11648
|
+
"line": 89
|
|
11579
11649
|
},
|
|
11580
11650
|
"name": "url",
|
|
11581
11651
|
"overrides": "cdk-nextjs.NextjsBaseConstruct",
|
|
@@ -11589,7 +11659,7 @@
|
|
|
11589
11659
|
},
|
|
11590
11660
|
"locationInModule": {
|
|
11591
11661
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11592
|
-
"line":
|
|
11662
|
+
"line": 81
|
|
11593
11663
|
},
|
|
11594
11664
|
"name": "nextjsContainers",
|
|
11595
11665
|
"type": {
|
|
@@ -11602,7 +11672,7 @@
|
|
|
11602
11672
|
},
|
|
11603
11673
|
"locationInModule": {
|
|
11604
11674
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11605
|
-
"line":
|
|
11675
|
+
"line": 82
|
|
11606
11676
|
},
|
|
11607
11677
|
"name": "nextjsDistribution",
|
|
11608
11678
|
"type": {
|
|
@@ -11615,7 +11685,7 @@
|
|
|
11615
11685
|
},
|
|
11616
11686
|
"locationInModule": {
|
|
11617
11687
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11618
|
-
"line":
|
|
11688
|
+
"line": 83
|
|
11619
11689
|
},
|
|
11620
11690
|
"name": "nextjsPostDeploy",
|
|
11621
11691
|
"type": {
|
|
@@ -11638,7 +11708,7 @@
|
|
|
11638
11708
|
"kind": "interface",
|
|
11639
11709
|
"locationInModule": {
|
|
11640
11710
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11641
|
-
"line":
|
|
11711
|
+
"line": 32
|
|
11642
11712
|
},
|
|
11643
11713
|
"name": "NextjsGlobalContainersConstructOverrides",
|
|
11644
11714
|
"properties": [
|
|
@@ -11650,7 +11720,7 @@
|
|
|
11650
11720
|
"immutable": true,
|
|
11651
11721
|
"locationInModule": {
|
|
11652
11722
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11653
|
-
"line":
|
|
11723
|
+
"line": 33
|
|
11654
11724
|
},
|
|
11655
11725
|
"name": "nextjsContainersProps",
|
|
11656
11726
|
"optional": true,
|
|
@@ -11666,7 +11736,7 @@
|
|
|
11666
11736
|
"immutable": true,
|
|
11667
11737
|
"locationInModule": {
|
|
11668
11738
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11669
|
-
"line":
|
|
11739
|
+
"line": 34
|
|
11670
11740
|
},
|
|
11671
11741
|
"name": "nextjsDistributionProps",
|
|
11672
11742
|
"optional": true,
|
|
@@ -11682,7 +11752,7 @@
|
|
|
11682
11752
|
"immutable": true,
|
|
11683
11753
|
"locationInModule": {
|
|
11684
11754
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11685
|
-
"line":
|
|
11755
|
+
"line": 35
|
|
11686
11756
|
},
|
|
11687
11757
|
"name": "nextjsPostDeployProps",
|
|
11688
11758
|
"optional": true,
|
|
@@ -11708,7 +11778,7 @@
|
|
|
11708
11778
|
"kind": "interface",
|
|
11709
11779
|
"locationInModule": {
|
|
11710
11780
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11711
|
-
"line":
|
|
11781
|
+
"line": 43
|
|
11712
11782
|
},
|
|
11713
11783
|
"name": "NextjsGlobalContainersOverrides",
|
|
11714
11784
|
"properties": [
|
|
@@ -11720,7 +11790,7 @@
|
|
|
11720
11790
|
"immutable": true,
|
|
11721
11791
|
"locationInModule": {
|
|
11722
11792
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11723
|
-
"line":
|
|
11793
|
+
"line": 45
|
|
11724
11794
|
},
|
|
11725
11795
|
"name": "nextjsContainers",
|
|
11726
11796
|
"optional": true,
|
|
@@ -11736,7 +11806,7 @@
|
|
|
11736
11806
|
"immutable": true,
|
|
11737
11807
|
"locationInModule": {
|
|
11738
11808
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11739
|
-
"line":
|
|
11809
|
+
"line": 46
|
|
11740
11810
|
},
|
|
11741
11811
|
"name": "nextjsDistribution",
|
|
11742
11812
|
"optional": true,
|
|
@@ -11752,7 +11822,7 @@
|
|
|
11752
11822
|
"immutable": true,
|
|
11753
11823
|
"locationInModule": {
|
|
11754
11824
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11755
|
-
"line":
|
|
11825
|
+
"line": 44
|
|
11756
11826
|
},
|
|
11757
11827
|
"name": "nextjsGlobalContainers",
|
|
11758
11828
|
"optional": true,
|
|
@@ -11768,7 +11838,7 @@
|
|
|
11768
11838
|
"immutable": true,
|
|
11769
11839
|
"locationInModule": {
|
|
11770
11840
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11771
|
-
"line":
|
|
11841
|
+
"line": 47
|
|
11772
11842
|
},
|
|
11773
11843
|
"name": "nextjsPostDeploy",
|
|
11774
11844
|
"optional": true,
|
|
@@ -11792,7 +11862,7 @@
|
|
|
11792
11862
|
"kind": "interface",
|
|
11793
11863
|
"locationInModule": {
|
|
11794
11864
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11795
|
-
"line":
|
|
11865
|
+
"line": 50
|
|
11796
11866
|
},
|
|
11797
11867
|
"name": "NextjsGlobalContainersProps",
|
|
11798
11868
|
"properties": [
|
|
@@ -11806,7 +11876,7 @@
|
|
|
11806
11876
|
"immutable": true,
|
|
11807
11877
|
"locationInModule": {
|
|
11808
11878
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11809
|
-
"line":
|
|
11879
|
+
"line": 57
|
|
11810
11880
|
},
|
|
11811
11881
|
"name": "alb",
|
|
11812
11882
|
"optional": true,
|
|
@@ -11824,7 +11894,7 @@
|
|
|
11824
11894
|
"immutable": true,
|
|
11825
11895
|
"locationInModule": {
|
|
11826
11896
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11827
|
-
"line":
|
|
11897
|
+
"line": 62
|
|
11828
11898
|
},
|
|
11829
11899
|
"name": "distribution",
|
|
11830
11900
|
"optional": true,
|
|
@@ -11842,7 +11912,7 @@
|
|
|
11842
11912
|
"immutable": true,
|
|
11843
11913
|
"locationInModule": {
|
|
11844
11914
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11845
|
-
"line":
|
|
11915
|
+
"line": 67
|
|
11846
11916
|
},
|
|
11847
11917
|
"name": "ecsCluster",
|
|
11848
11918
|
"optional": true,
|
|
@@ -11859,7 +11929,7 @@
|
|
|
11859
11929
|
"immutable": true,
|
|
11860
11930
|
"locationInModule": {
|
|
11861
11931
|
"filename": "src/root-constructs/nextjs-global-containers.ts",
|
|
11862
|
-
"line":
|
|
11932
|
+
"line": 71
|
|
11863
11933
|
},
|
|
11864
11934
|
"name": "overrides",
|
|
11865
11935
|
"optional": true,
|
|
@@ -11884,7 +11954,7 @@
|
|
|
11884
11954
|
},
|
|
11885
11955
|
"locationInModule": {
|
|
11886
11956
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
11887
|
-
"line":
|
|
11957
|
+
"line": 94
|
|
11888
11958
|
},
|
|
11889
11959
|
"parameters": [
|
|
11890
11960
|
{
|
|
@@ -11910,18 +11980,19 @@
|
|
|
11910
11980
|
"kind": "class",
|
|
11911
11981
|
"locationInModule": {
|
|
11912
11982
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
11913
|
-
"line":
|
|
11983
|
+
"line": 70
|
|
11914
11984
|
},
|
|
11915
11985
|
"name": "NextjsGlobalFunctions",
|
|
11916
11986
|
"properties": [
|
|
11917
11987
|
{
|
|
11918
11988
|
"docs": {
|
|
11919
|
-
"stability": "stable"
|
|
11989
|
+
"stability": "stable",
|
|
11990
|
+
"summary": "Public URL of the app, including `basePath` — the app only answers under that prefix, and it's derived from the app's own `basePath` when the prop is left unset, so it's there whether or not you asked for it."
|
|
11920
11991
|
},
|
|
11921
11992
|
"immutable": true,
|
|
11922
11993
|
"locationInModule": {
|
|
11923
11994
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
11924
|
-
"line":
|
|
11995
|
+
"line": 85
|
|
11925
11996
|
},
|
|
11926
11997
|
"name": "url",
|
|
11927
11998
|
"overrides": "cdk-nextjs.NextjsBaseConstruct",
|
|
@@ -11935,7 +12006,7 @@
|
|
|
11935
12006
|
},
|
|
11936
12007
|
"locationInModule": {
|
|
11937
12008
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
11938
|
-
"line":
|
|
12009
|
+
"line": 78
|
|
11939
12010
|
},
|
|
11940
12011
|
"name": "nextjsDistribution",
|
|
11941
12012
|
"type": {
|
|
@@ -11948,7 +12019,7 @@
|
|
|
11948
12019
|
},
|
|
11949
12020
|
"locationInModule": {
|
|
11950
12021
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
11951
|
-
"line":
|
|
12022
|
+
"line": 71
|
|
11952
12023
|
},
|
|
11953
12024
|
"name": "nextjsFunctions",
|
|
11954
12025
|
"type": {
|
|
@@ -11961,7 +12032,7 @@
|
|
|
11961
12032
|
},
|
|
11962
12033
|
"locationInModule": {
|
|
11963
12034
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
11964
|
-
"line":
|
|
12035
|
+
"line": 79
|
|
11965
12036
|
},
|
|
11966
12037
|
"name": "nextjsPostDeploy",
|
|
11967
12038
|
"type": {
|
|
@@ -11976,7 +12047,7 @@
|
|
|
11976
12047
|
},
|
|
11977
12048
|
"locationInModule": {
|
|
11978
12049
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
11979
|
-
"line":
|
|
12050
|
+
"line": 77
|
|
11980
12051
|
},
|
|
11981
12052
|
"name": "nextjsImageFunction",
|
|
11982
12053
|
"optional": true,
|
|
@@ -12000,7 +12071,7 @@
|
|
|
12000
12071
|
"kind": "interface",
|
|
12001
12072
|
"locationInModule": {
|
|
12002
12073
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12003
|
-
"line":
|
|
12074
|
+
"line": 34
|
|
12004
12075
|
},
|
|
12005
12076
|
"name": "NextjsGlobalFunctionsConstructOverrides",
|
|
12006
12077
|
"properties": [
|
|
@@ -12012,7 +12083,7 @@
|
|
|
12012
12083
|
"immutable": true,
|
|
12013
12084
|
"locationInModule": {
|
|
12014
12085
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12015
|
-
"line":
|
|
12086
|
+
"line": 35
|
|
12016
12087
|
},
|
|
12017
12088
|
"name": "nextjsDistributionProps",
|
|
12018
12089
|
"optional": true,
|
|
@@ -12028,7 +12099,7 @@
|
|
|
12028
12099
|
"immutable": true,
|
|
12029
12100
|
"locationInModule": {
|
|
12030
12101
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12031
|
-
"line":
|
|
12102
|
+
"line": 36
|
|
12032
12103
|
},
|
|
12033
12104
|
"name": "nextjsPostDeployProps",
|
|
12034
12105
|
"optional": true,
|
|
@@ -12054,7 +12125,7 @@
|
|
|
12054
12125
|
"kind": "interface",
|
|
12055
12126
|
"locationInModule": {
|
|
12056
12127
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12057
|
-
"line":
|
|
12128
|
+
"line": 44
|
|
12058
12129
|
},
|
|
12059
12130
|
"name": "NextjsGlobalFunctionsOverrides",
|
|
12060
12131
|
"properties": [
|
|
@@ -12066,7 +12137,7 @@
|
|
|
12066
12137
|
"immutable": true,
|
|
12067
12138
|
"locationInModule": {
|
|
12068
12139
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12069
|
-
"line":
|
|
12140
|
+
"line": 48
|
|
12070
12141
|
},
|
|
12071
12142
|
"name": "nextjsDistribution",
|
|
12072
12143
|
"optional": true,
|
|
@@ -12082,7 +12153,7 @@
|
|
|
12082
12153
|
"immutable": true,
|
|
12083
12154
|
"locationInModule": {
|
|
12084
12155
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12085
|
-
"line":
|
|
12156
|
+
"line": 46
|
|
12086
12157
|
},
|
|
12087
12158
|
"name": "nextjsFunctions",
|
|
12088
12159
|
"optional": true,
|
|
@@ -12098,7 +12169,7 @@
|
|
|
12098
12169
|
"immutable": true,
|
|
12099
12170
|
"locationInModule": {
|
|
12100
12171
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12101
|
-
"line":
|
|
12172
|
+
"line": 45
|
|
12102
12173
|
},
|
|
12103
12174
|
"name": "nextjsGlobalFunctions",
|
|
12104
12175
|
"optional": true,
|
|
@@ -12114,7 +12185,7 @@
|
|
|
12114
12185
|
"immutable": true,
|
|
12115
12186
|
"locationInModule": {
|
|
12116
12187
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12117
|
-
"line":
|
|
12188
|
+
"line": 47
|
|
12118
12189
|
},
|
|
12119
12190
|
"name": "nextjsImageFunction",
|
|
12120
12191
|
"optional": true,
|
|
@@ -12130,7 +12201,7 @@
|
|
|
12130
12201
|
"immutable": true,
|
|
12131
12202
|
"locationInModule": {
|
|
12132
12203
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12133
|
-
"line":
|
|
12204
|
+
"line": 49
|
|
12134
12205
|
},
|
|
12135
12206
|
"name": "nextjsPostDeploy",
|
|
12136
12207
|
"optional": true,
|
|
@@ -12154,7 +12225,7 @@
|
|
|
12154
12225
|
"kind": "interface",
|
|
12155
12226
|
"locationInModule": {
|
|
12156
12227
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12157
|
-
"line":
|
|
12228
|
+
"line": 52
|
|
12158
12229
|
},
|
|
12159
12230
|
"name": "NextjsGlobalFunctionsProps",
|
|
12160
12231
|
"properties": [
|
|
@@ -12168,7 +12239,7 @@
|
|
|
12168
12239
|
"immutable": true,
|
|
12169
12240
|
"locationInModule": {
|
|
12170
12241
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12171
|
-
"line":
|
|
12242
|
+
"line": 57
|
|
12172
12243
|
},
|
|
12173
12244
|
"name": "distribution",
|
|
12174
12245
|
"optional": true,
|
|
@@ -12185,7 +12256,7 @@
|
|
|
12185
12256
|
"immutable": true,
|
|
12186
12257
|
"locationInModule": {
|
|
12187
12258
|
"filename": "src/root-constructs/nextjs-global-functions.ts",
|
|
12188
|
-
"line":
|
|
12259
|
+
"line": 61
|
|
12189
12260
|
},
|
|
12190
12261
|
"name": "overrides",
|
|
12191
12262
|
"optional": true,
|
|
@@ -12210,7 +12281,7 @@
|
|
|
12210
12281
|
},
|
|
12211
12282
|
"locationInModule": {
|
|
12212
12283
|
"filename": "src/nextjs-compute/nextjs-image-function.ts",
|
|
12213
|
-
"line":
|
|
12284
|
+
"line": 67
|
|
12214
12285
|
},
|
|
12215
12286
|
"parameters": [
|
|
12216
12287
|
{
|
|
@@ -12236,7 +12307,7 @@
|
|
|
12236
12307
|
"kind": "class",
|
|
12237
12308
|
"locationInModule": {
|
|
12238
12309
|
"filename": "src/nextjs-compute/nextjs-image-function.ts",
|
|
12239
|
-
"line":
|
|
12310
|
+
"line": 61
|
|
12240
12311
|
},
|
|
12241
12312
|
"name": "NextjsImageFunction",
|
|
12242
12313
|
"properties": [
|
|
@@ -12246,7 +12317,7 @@
|
|
|
12246
12317
|
},
|
|
12247
12318
|
"locationInModule": {
|
|
12248
12319
|
"filename": "src/nextjs-compute/nextjs-image-function.ts",
|
|
12249
|
-
"line":
|
|
12320
|
+
"line": 62
|
|
12250
12321
|
},
|
|
12251
12322
|
"name": "function",
|
|
12252
12323
|
"type": {
|
|
@@ -12259,7 +12330,7 @@
|
|
|
12259
12330
|
},
|
|
12260
12331
|
"locationInModule": {
|
|
12261
12332
|
"filename": "src/nextjs-compute/nextjs-image-function.ts",
|
|
12262
|
-
"line":
|
|
12333
|
+
"line": 63
|
|
12263
12334
|
},
|
|
12264
12335
|
"name": "functionUrl",
|
|
12265
12336
|
"optional": true,
|
|
@@ -12390,7 +12461,7 @@
|
|
|
12390
12461
|
"immutable": true,
|
|
12391
12462
|
"locationInModule": {
|
|
12392
12463
|
"filename": "src/nextjs-compute/nextjs-image-function.ts",
|
|
12393
|
-
"line":
|
|
12464
|
+
"line": 52
|
|
12394
12465
|
},
|
|
12395
12466
|
"name": "overrides",
|
|
12396
12467
|
"optional": true,
|
|
@@ -12398,6 +12469,24 @@
|
|
|
12398
12469
|
"fqn": "cdk-nextjs.NextjsImageFunctionOverrides"
|
|
12399
12470
|
}
|
|
12400
12471
|
},
|
|
12472
|
+
{
|
|
12473
|
+
"abstract": true,
|
|
12474
|
+
"docs": {
|
|
12475
|
+
"remarks": "Threaded through explicitly rather than read from the app's bundled config,\nbecause it's distinct from the app's own `basePath` (which next-image-loader\nbakes into hrefs) — the two diverge when the app's `basePath` comes from\nelsewhere, e.g. an API Gateway stage under `NextjsRegionalFunctions`.",
|
|
12476
|
+
"stability": "stable",
|
|
12477
|
+
"summary": "S3 key prefix the static assets were uploaded under, i.e. `NextjsStaticAssets.keyPrefix`, which namespaces a shared bucket."
|
|
12478
|
+
},
|
|
12479
|
+
"immutable": true,
|
|
12480
|
+
"locationInModule": {
|
|
12481
|
+
"filename": "src/nextjs-compute/nextjs-image-function.ts",
|
|
12482
|
+
"line": 47
|
|
12483
|
+
},
|
|
12484
|
+
"name": "staticAssetsKeyPrefix",
|
|
12485
|
+
"optional": true,
|
|
12486
|
+
"type": {
|
|
12487
|
+
"primitive": "string"
|
|
12488
|
+
}
|
|
12489
|
+
},
|
|
12401
12490
|
{
|
|
12402
12491
|
"abstract": true,
|
|
12403
12492
|
"docs": {
|
|
@@ -12406,7 +12495,7 @@
|
|
|
12406
12495
|
"immutable": true,
|
|
12407
12496
|
"locationInModule": {
|
|
12408
12497
|
"filename": "src/nextjs-compute/nextjs-image-function.ts",
|
|
12409
|
-
"line":
|
|
12498
|
+
"line": 48
|
|
12410
12499
|
},
|
|
12411
12500
|
"name": "vpc",
|
|
12412
12501
|
"optional": true,
|
|
@@ -12990,7 +13079,7 @@
|
|
|
12990
13079
|
},
|
|
12991
13080
|
"locationInModule": {
|
|
12992
13081
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
12993
|
-
"line":
|
|
13082
|
+
"line": 70
|
|
12994
13083
|
},
|
|
12995
13084
|
"parameters": [
|
|
12996
13085
|
{
|
|
@@ -13016,7 +13105,7 @@
|
|
|
13016
13105
|
"kind": "class",
|
|
13017
13106
|
"locationInModule": {
|
|
13018
13107
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13019
|
-
"line":
|
|
13108
|
+
"line": 54
|
|
13020
13109
|
},
|
|
13021
13110
|
"name": "NextjsRegionalFunctions",
|
|
13022
13111
|
"properties": [
|
|
@@ -13027,7 +13116,7 @@
|
|
|
13027
13116
|
"immutable": true,
|
|
13028
13117
|
"locationInModule": {
|
|
13029
13118
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13030
|
-
"line":
|
|
13119
|
+
"line": 64
|
|
13031
13120
|
},
|
|
13032
13121
|
"name": "url",
|
|
13033
13122
|
"overrides": "cdk-nextjs.NextjsBaseConstruct",
|
|
@@ -13041,7 +13130,7 @@
|
|
|
13041
13130
|
},
|
|
13042
13131
|
"locationInModule": {
|
|
13043
13132
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13044
|
-
"line":
|
|
13133
|
+
"line": 62
|
|
13045
13134
|
},
|
|
13046
13135
|
"name": "nextjsApi",
|
|
13047
13136
|
"type": {
|
|
@@ -13054,7 +13143,7 @@
|
|
|
13054
13143
|
},
|
|
13055
13144
|
"locationInModule": {
|
|
13056
13145
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13057
|
-
"line":
|
|
13146
|
+
"line": 55
|
|
13058
13147
|
},
|
|
13059
13148
|
"name": "nextjsFunctions",
|
|
13060
13149
|
"type": {
|
|
@@ -13067,7 +13156,7 @@
|
|
|
13067
13156
|
},
|
|
13068
13157
|
"locationInModule": {
|
|
13069
13158
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13070
|
-
"line":
|
|
13159
|
+
"line": 63
|
|
13071
13160
|
},
|
|
13072
13161
|
"name": "nextjsPostDeploy",
|
|
13073
13162
|
"type": {
|
|
@@ -13082,7 +13171,7 @@
|
|
|
13082
13171
|
},
|
|
13083
13172
|
"locationInModule": {
|
|
13084
13173
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13085
|
-
"line":
|
|
13174
|
+
"line": 61
|
|
13086
13175
|
},
|
|
13087
13176
|
"name": "nextjsImageFunction",
|
|
13088
13177
|
"optional": true,
|
|
@@ -13106,7 +13195,7 @@
|
|
|
13106
13195
|
"kind": "interface",
|
|
13107
13196
|
"locationInModule": {
|
|
13108
13197
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13109
|
-
"line":
|
|
13198
|
+
"line": 25
|
|
13110
13199
|
},
|
|
13111
13200
|
"name": "NextjsRegionalFunctionsConstructOverrides",
|
|
13112
13201
|
"properties": [
|
|
@@ -13118,7 +13207,7 @@
|
|
|
13118
13207
|
"immutable": true,
|
|
13119
13208
|
"locationInModule": {
|
|
13120
13209
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13121
|
-
"line":
|
|
13210
|
+
"line": 26
|
|
13122
13211
|
},
|
|
13123
13212
|
"name": "nextjsApiProps",
|
|
13124
13213
|
"optional": true,
|
|
@@ -13134,7 +13223,7 @@
|
|
|
13134
13223
|
"immutable": true,
|
|
13135
13224
|
"locationInModule": {
|
|
13136
13225
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13137
|
-
"line":
|
|
13226
|
+
"line": 27
|
|
13138
13227
|
},
|
|
13139
13228
|
"name": "nextjsPostDeployProps",
|
|
13140
13229
|
"optional": true,
|
|
@@ -13160,7 +13249,7 @@
|
|
|
13160
13249
|
"kind": "interface",
|
|
13161
13250
|
"locationInModule": {
|
|
13162
13251
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13163
|
-
"line":
|
|
13252
|
+
"line": 35
|
|
13164
13253
|
},
|
|
13165
13254
|
"name": "NextjsRegionalFunctionsOverrides",
|
|
13166
13255
|
"properties": [
|
|
@@ -13172,7 +13261,7 @@
|
|
|
13172
13261
|
"immutable": true,
|
|
13173
13262
|
"locationInModule": {
|
|
13174
13263
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13175
|
-
"line":
|
|
13264
|
+
"line": 39
|
|
13176
13265
|
},
|
|
13177
13266
|
"name": "nextjsApi",
|
|
13178
13267
|
"optional": true,
|
|
@@ -13188,7 +13277,7 @@
|
|
|
13188
13277
|
"immutable": true,
|
|
13189
13278
|
"locationInModule": {
|
|
13190
13279
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13191
|
-
"line":
|
|
13280
|
+
"line": 37
|
|
13192
13281
|
},
|
|
13193
13282
|
"name": "nextjsFunctions",
|
|
13194
13283
|
"optional": true,
|
|
@@ -13204,7 +13293,7 @@
|
|
|
13204
13293
|
"immutable": true,
|
|
13205
13294
|
"locationInModule": {
|
|
13206
13295
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13207
|
-
"line":
|
|
13296
|
+
"line": 38
|
|
13208
13297
|
},
|
|
13209
13298
|
"name": "nextjsImageFunction",
|
|
13210
13299
|
"optional": true,
|
|
@@ -13220,7 +13309,7 @@
|
|
|
13220
13309
|
"immutable": true,
|
|
13221
13310
|
"locationInModule": {
|
|
13222
13311
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13223
|
-
"line":
|
|
13312
|
+
"line": 40
|
|
13224
13313
|
},
|
|
13225
13314
|
"name": "nextjsPostDeploy",
|
|
13226
13315
|
"optional": true,
|
|
@@ -13236,7 +13325,7 @@
|
|
|
13236
13325
|
"immutable": true,
|
|
13237
13326
|
"locationInModule": {
|
|
13238
13327
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13239
|
-
"line":
|
|
13328
|
+
"line": 36
|
|
13240
13329
|
},
|
|
13241
13330
|
"name": "nextjsRegionalFunctions",
|
|
13242
13331
|
"optional": true,
|
|
@@ -13260,7 +13349,7 @@
|
|
|
13260
13349
|
"kind": "interface",
|
|
13261
13350
|
"locationInModule": {
|
|
13262
13351
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13263
|
-
"line":
|
|
13352
|
+
"line": 43
|
|
13264
13353
|
},
|
|
13265
13354
|
"name": "NextjsRegionalFunctionsProps",
|
|
13266
13355
|
"properties": [
|
|
@@ -13273,7 +13362,7 @@
|
|
|
13273
13362
|
"immutable": true,
|
|
13274
13363
|
"locationInModule": {
|
|
13275
13364
|
"filename": "src/root-constructs/nextjs-regional-functions.ts",
|
|
13276
|
-
"line":
|
|
13365
|
+
"line": 47
|
|
13277
13366
|
},
|
|
13278
13367
|
"name": "overrides",
|
|
13279
13368
|
"optional": true,
|
|
@@ -13298,7 +13387,7 @@
|
|
|
13298
13387
|
},
|
|
13299
13388
|
"locationInModule": {
|
|
13300
13389
|
"filename": "src/nextjs-static-assets.ts",
|
|
13301
|
-
"line":
|
|
13390
|
+
"line": 77
|
|
13302
13391
|
},
|
|
13303
13392
|
"parameters": [
|
|
13304
13393
|
{
|
|
@@ -13324,17 +13413,33 @@
|
|
|
13324
13413
|
"kind": "class",
|
|
13325
13414
|
"locationInModule": {
|
|
13326
13415
|
"filename": "src/nextjs-static-assets.ts",
|
|
13327
|
-
"line":
|
|
13416
|
+
"line": 60
|
|
13328
13417
|
},
|
|
13329
13418
|
"name": "NextjsStaticAssets",
|
|
13330
13419
|
"properties": [
|
|
13420
|
+
{
|
|
13421
|
+
"docs": {
|
|
13422
|
+
"remarks": "Consumers that read assets back out of the bucket (the image optimization\nLambda, `NextjsApi`'s S3 integrations) must use this rather than the\n`basePath` prop, since `overrides.bucketDeploymentProps` can replace the\nprefix outright.",
|
|
13423
|
+
"stability": "stable",
|
|
13424
|
+
"summary": "S3 key prefix the assets are actually uploaded under, normalized to a bare path segment (empty when they live at the bucket root)."
|
|
13425
|
+
},
|
|
13426
|
+
"immutable": true,
|
|
13427
|
+
"locationInModule": {
|
|
13428
|
+
"filename": "src/nextjs-static-assets.ts",
|
|
13429
|
+
"line": 72
|
|
13430
|
+
},
|
|
13431
|
+
"name": "keyPrefix",
|
|
13432
|
+
"type": {
|
|
13433
|
+
"primitive": "string"
|
|
13434
|
+
}
|
|
13435
|
+
},
|
|
13331
13436
|
{
|
|
13332
13437
|
"docs": {
|
|
13333
13438
|
"stability": "stable"
|
|
13334
13439
|
},
|
|
13335
13440
|
"locationInModule": {
|
|
13336
13441
|
"filename": "src/nextjs-static-assets.ts",
|
|
13337
|
-
"line":
|
|
13442
|
+
"line": 61
|
|
13338
13443
|
},
|
|
13339
13444
|
"name": "bucket",
|
|
13340
13445
|
"type": {
|
|
@@ -13347,7 +13452,7 @@
|
|
|
13347
13452
|
},
|
|
13348
13453
|
"locationInModule": {
|
|
13349
13454
|
"filename": "src/nextjs-static-assets.ts",
|
|
13350
|
-
"line":
|
|
13455
|
+
"line": 62
|
|
13351
13456
|
},
|
|
13352
13457
|
"name": "deployment",
|
|
13353
13458
|
"type": {
|
|
@@ -13367,7 +13472,7 @@
|
|
|
13367
13472
|
"kind": "interface",
|
|
13368
13473
|
"locationInModule": {
|
|
13369
13474
|
"filename": "src/nextjs-static-assets.ts",
|
|
13370
|
-
"line":
|
|
13475
|
+
"line": 28
|
|
13371
13476
|
},
|
|
13372
13477
|
"name": "NextjsStaticAssetsOverrides",
|
|
13373
13478
|
"properties": [
|
|
@@ -13379,7 +13484,7 @@
|
|
|
13379
13484
|
"immutable": true,
|
|
13380
13485
|
"locationInModule": {
|
|
13381
13486
|
"filename": "src/nextjs-static-assets.ts",
|
|
13382
|
-
"line":
|
|
13487
|
+
"line": 30
|
|
13383
13488
|
},
|
|
13384
13489
|
"name": "bucketDeploymentProps",
|
|
13385
13490
|
"optional": true,
|
|
@@ -13395,7 +13500,7 @@
|
|
|
13395
13500
|
"immutable": true,
|
|
13396
13501
|
"locationInModule": {
|
|
13397
13502
|
"filename": "src/nextjs-static-assets.ts",
|
|
13398
|
-
"line":
|
|
13503
|
+
"line": 29
|
|
13399
13504
|
},
|
|
13400
13505
|
"name": "bucketProps",
|
|
13401
13506
|
"optional": true,
|
|
@@ -13416,7 +13521,7 @@
|
|
|
13416
13521
|
"kind": "interface",
|
|
13417
13522
|
"locationInModule": {
|
|
13418
13523
|
"filename": "src/nextjs-static-assets.ts",
|
|
13419
|
-
"line":
|
|
13524
|
+
"line": 33
|
|
13420
13525
|
},
|
|
13421
13526
|
"name": "NextjsStaticAssetsProps",
|
|
13422
13527
|
"properties": [
|
|
@@ -13429,7 +13534,7 @@
|
|
|
13429
13534
|
"immutable": true,
|
|
13430
13535
|
"locationInModule": {
|
|
13431
13536
|
"filename": "src/nextjs-static-assets.ts",
|
|
13432
|
-
"line":
|
|
13537
|
+
"line": 44
|
|
13433
13538
|
},
|
|
13434
13539
|
"name": "buildDirectory",
|
|
13435
13540
|
"type": {
|
|
@@ -13445,7 +13550,7 @@
|
|
|
13445
13550
|
"immutable": true,
|
|
13446
13551
|
"locationInModule": {
|
|
13447
13552
|
"filename": "src/nextjs-static-assets.ts",
|
|
13448
|
-
"line":
|
|
13553
|
+
"line": 48
|
|
13449
13554
|
},
|
|
13450
13555
|
"name": "buildId",
|
|
13451
13556
|
"type": {
|
|
@@ -13462,7 +13567,7 @@
|
|
|
13462
13567
|
"immutable": true,
|
|
13463
13568
|
"locationInModule": {
|
|
13464
13569
|
"filename": "src/nextjs-static-assets.ts",
|
|
13465
|
-
"line":
|
|
13570
|
+
"line": 53
|
|
13466
13571
|
},
|
|
13467
13572
|
"name": "basePath",
|
|
13468
13573
|
"optional": true,
|
|
@@ -13480,7 +13585,7 @@
|
|
|
13480
13585
|
"immutable": true,
|
|
13481
13586
|
"locationInModule": {
|
|
13482
13587
|
"filename": "src/nextjs-static-assets.ts",
|
|
13483
|
-
"line":
|
|
13588
|
+
"line": 39
|
|
13484
13589
|
},
|
|
13485
13590
|
"name": "bucket",
|
|
13486
13591
|
"optional": true,
|
|
@@ -13496,7 +13601,7 @@
|
|
|
13496
13601
|
"immutable": true,
|
|
13497
13602
|
"locationInModule": {
|
|
13498
13603
|
"filename": "src/nextjs-static-assets.ts",
|
|
13499
|
-
"line":
|
|
13604
|
+
"line": 54
|
|
13500
13605
|
},
|
|
13501
13606
|
"name": "overrides",
|
|
13502
13607
|
"optional": true,
|
|
@@ -18737,7 +18842,7 @@
|
|
|
18737
18842
|
"immutable": true,
|
|
18738
18843
|
"locationInModule": {
|
|
18739
18844
|
"filename": "src/generated-structs/OptionalNextjsDistributionProps.ts",
|
|
18740
|
-
"line":
|
|
18845
|
+
"line": 59
|
|
18741
18846
|
},
|
|
18742
18847
|
"name": "assetsBucket",
|
|
18743
18848
|
"optional": true,
|
|
@@ -18748,12 +18853,14 @@
|
|
|
18748
18853
|
{
|
|
18749
18854
|
"abstract": true,
|
|
18750
18855
|
"docs": {
|
|
18751
|
-
"
|
|
18856
|
+
"remarks": "Surrounding slashes are normalized\naway, so \"/base\", \"base\" and \"/base/\" all produce the same cache behaviors.",
|
|
18857
|
+
"stability": "stable",
|
|
18858
|
+
"summary": "URI path prefix the app is served at."
|
|
18752
18859
|
},
|
|
18753
18860
|
"immutable": true,
|
|
18754
18861
|
"locationInModule": {
|
|
18755
18862
|
"filename": "src/generated-structs/OptionalNextjsDistributionProps.ts",
|
|
18756
|
-
"line":
|
|
18863
|
+
"line": 44
|
|
18757
18864
|
},
|
|
18758
18865
|
"name": "basePath",
|
|
18759
18866
|
"optional": true,
|
|
@@ -18854,7 +18961,7 @@
|
|
|
18854
18961
|
"immutable": true,
|
|
18855
18962
|
"locationInModule": {
|
|
18856
18963
|
"filename": "src/generated-structs/OptionalNextjsDistributionProps.ts",
|
|
18857
|
-
"line":
|
|
18964
|
+
"line": 53
|
|
18858
18965
|
},
|
|
18859
18966
|
"name": "nextjsType",
|
|
18860
18967
|
"optional": true,
|
|
@@ -18871,7 +18978,7 @@
|
|
|
18871
18978
|
"immutable": true,
|
|
18872
18979
|
"locationInModule": {
|
|
18873
18980
|
"filename": "src/generated-structs/OptionalNextjsDistributionProps.ts",
|
|
18874
|
-
"line":
|
|
18981
|
+
"line": 49
|
|
18875
18982
|
},
|
|
18876
18983
|
"name": "publicDirEntries",
|
|
18877
18984
|
"optional": true,
|
|
@@ -19977,7 +20084,7 @@
|
|
|
19977
20084
|
"kind": "interface",
|
|
19978
20085
|
"locationInModule": {
|
|
19979
20086
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
19980
|
-
"line":
|
|
20087
|
+
"line": 45
|
|
19981
20088
|
},
|
|
19982
20089
|
"name": "PublicDirEntry",
|
|
19983
20090
|
"properties": [
|
|
@@ -19989,7 +20096,7 @@
|
|
|
19989
20096
|
"immutable": true,
|
|
19990
20097
|
"locationInModule": {
|
|
19991
20098
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
19992
|
-
"line":
|
|
20099
|
+
"line": 47
|
|
19993
20100
|
},
|
|
19994
20101
|
"name": "isDirectory",
|
|
19995
20102
|
"type": {
|
|
@@ -20004,7 +20111,7 @@
|
|
|
20004
20111
|
"immutable": true,
|
|
20005
20112
|
"locationInModule": {
|
|
20006
20113
|
"filename": "src/nextjs-build/nextjs-build.ts",
|
|
20007
|
-
"line":
|
|
20114
|
+
"line": 46
|
|
20008
20115
|
},
|
|
20009
20116
|
"name": "name",
|
|
20010
20117
|
"type": {
|
|
@@ -20015,6 +20122,6 @@
|
|
|
20015
20122
|
"symbolId": "src/nextjs-build/nextjs-build:PublicDirEntry"
|
|
20016
20123
|
}
|
|
20017
20124
|
},
|
|
20018
|
-
"version": "0.
|
|
20019
|
-
"fingerprint": "
|
|
20125
|
+
"version": "0.6.0",
|
|
20126
|
+
"fingerprint": "pFFkq0kZiIR22+vr8dHzSYSgrCGrr7EuMSFNU7NYwag="
|
|
20020
20127
|
}
|