cdk-nextjs 0.5.14 → 0.5.16

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.
Files changed (51) hide show
  1. package/.jsii +719 -258
  2. package/.jsii.tabl.json +1 -1
  3. package/API.md +543 -14
  4. package/README.md +1 -1
  5. package/docs/breaking-changes.md +33 -0
  6. package/docs/caching-guide.md +9 -0
  7. package/docs/plans/adapter-runtime-release.md +362 -0
  8. package/docs/plans/phase-0-image-function-opt-in.md +295 -0
  9. package/lib/adapter/cache-handler.mjs +50916 -13061
  10. package/lib/adapter/memory-cache-handler.d.ts +1 -1
  11. package/lib/adapter/memory-cache-handler.js +17 -11
  12. package/lib/adapter/memory-cache-handler.test.js +57 -1
  13. package/lib/adapter/s3-cache-handler.d.ts +33 -0
  14. package/lib/adapter/s3-cache-handler.js +96 -1
  15. package/lib/adapter/s3-cache-handler.test.js +66 -1
  16. package/lib/generated-structs/OptionalNextjsDistributionProps.d.ts +10 -0
  17. package/lib/generated-structs/OptionalNextjsDistributionProps.js +1 -1
  18. package/lib/image-optimization/handler-utils.d.ts +32 -0
  19. package/lib/image-optimization/handler-utils.js +77 -0
  20. package/lib/image-optimization/handler-utils.test.d.ts +1 -0
  21. package/lib/image-optimization/handler-utils.test.js +142 -0
  22. package/lib/image-optimization/handler.mjs +56112 -0
  23. package/lib/index.d.ts +2 -1
  24. package/lib/index.js +4 -2
  25. package/lib/nextjs-api.d.ts +18 -0
  26. package/lib/nextjs-api.js +25 -9
  27. package/lib/nextjs-build/nextjs-build.d.ts +52 -0
  28. package/lib/nextjs-build/nextjs-build.js +174 -27
  29. package/lib/nextjs-cache.js +1 -1
  30. package/lib/nextjs-compute/nextjs-containers.js +1 -1
  31. package/lib/nextjs-compute/nextjs-functions.js +1 -1
  32. package/lib/nextjs-compute/nextjs-image-function.d.ts +43 -0
  33. package/lib/nextjs-compute/nextjs-image-function.js +58 -0
  34. package/lib/nextjs-distribution.d.ts +22 -0
  35. package/lib/nextjs-distribution.js +25 -3
  36. package/lib/nextjs-post-deploy.js +1 -1
  37. package/lib/nextjs-static-assets.js +1 -1
  38. package/lib/root-constructs/nextjs-base-construct.d.ts +24 -1
  39. package/lib/root-constructs/nextjs-base-construct.js +42 -2
  40. package/lib/root-constructs/nextjs-global-containers.d.ts +15 -0
  41. package/lib/root-constructs/nextjs-global-containers.js +57 -2
  42. package/lib/root-constructs/nextjs-global-functions.d.ts +27 -5
  43. package/lib/root-constructs/nextjs-global-functions.js +67 -17
  44. package/lib/root-constructs/nextjs-regional-containers.js +1 -1
  45. package/lib/root-constructs/nextjs-regional-functions.d.ts +11 -5
  46. package/lib/root-constructs/nextjs-regional-functions.js +14 -18
  47. package/lib/utils/experimental-flags.d.ts +24 -0
  48. package/lib/utils/experimental-flags.js +30 -0
  49. package/lib/utils/get-architecture.d.ts +10 -0
  50. package/lib/utils/get-architecture.js +17 -2
  51. package/package.json +4 -1
package/API.md CHANGED
@@ -469,6 +469,7 @@ Any object.
469
469
  | <code><a href="#cdk-nextjs.NextjsBuild.property.publicDirEntries">publicDirEntries</a></code> | <code><a href="#cdk-nextjs.PublicDirEntry">PublicDirEntry</a>[]</code> | Absolute path to public. |
470
470
  | <code><a href="#cdk-nextjs.NextjsBuild.property.relativePathToEntrypoint">relativePathToEntrypoint</a></code> | <code>string</code> | The entrypoint JavaScript file used as an argument for Node.js to run the Next.js standalone server relative to the standalone directory. |
471
471
  | <code><a href="#cdk-nextjs.NextjsBuild.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | Relative path from the standalone directory to the package containing the Next.js app. This is automatically detected from the standalone build output. |
472
+ | <code><a href="#cdk-nextjs.NextjsBuild.property.imageOptimizationAssetPath">imageOptimizationAssetPath</a></code> | <code>string</code> | Absolute path to the directory prepared for the image optimization Lambda asset: bundled handler, glibc `sharp` binaries, and `required-server-files.json`. Only set for {@link NextjsType.GLOBAL_FUNCTIONS} and {@link NextjsType.REGIONAL_FUNCTIONS}, and only when the dedicated image optimization Lambda is enabled. |
472
473
 
473
474
  ---
474
475
 
@@ -586,6 +587,18 @@ Relative path from the standalone directory to the package containing the Next.j
586
587
  ```
587
588
 
588
589
 
590
+ ##### `imageOptimizationAssetPath`<sup>Optional</sup> <a name="imageOptimizationAssetPath" id="cdk-nextjs.NextjsBuild.property.imageOptimizationAssetPath"></a>
591
+
592
+ ```typescript
593
+ public readonly imageOptimizationAssetPath: string;
594
+ ```
595
+
596
+ - *Type:* string
597
+
598
+ Absolute path to the directory prepared for the image optimization Lambda asset: bundled handler, glibc `sharp` binaries, and `required-server-files.json`. Only set for {@link NextjsType.GLOBAL_FUNCTIONS} and {@link NextjsType.REGIONAL_FUNCTIONS}, and only when the dedicated image optimization Lambda is enabled.
599
+
600
+ ---
601
+
589
602
 
590
603
  ### NextjsCache <a name="NextjsCache" id="cdk-nextjs.NextjsCache"></a>
591
604
 
@@ -1616,6 +1629,7 @@ Any object.
1616
1629
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsDistribution">nextjsDistribution</a></code> | <code><a href="#cdk-nextjs.NextjsDistribution">NextjsDistribution</a></code> | *No description.* |
1617
1630
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsFunctions">nextjsFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsFunctions">NextjsFunctions</a></code> | *No description.* |
1618
1631
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a></code> | *No description.* |
1632
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsImageFunction">nextjsImageFunction</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunction">NextjsImageFunction</a></code> | Only created when the (experimental, unsupported) dedicated image optimization Lambda is enabled. |
1619
1633
 
1620
1634
  ---
1621
1635
 
@@ -1701,6 +1715,180 @@ public readonly nextjsPostDeploy: NextjsPostDeploy;
1701
1715
 
1702
1716
  ---
1703
1717
 
1718
+ ##### `nextjsImageFunction`<sup>Optional</sup> <a name="nextjsImageFunction" id="cdk-nextjs.NextjsGlobalFunctions.property.nextjsImageFunction"></a>
1719
+
1720
+ ```typescript
1721
+ public readonly nextjsImageFunction: NextjsImageFunction;
1722
+ ```
1723
+
1724
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunction">NextjsImageFunction</a>
1725
+
1726
+ Only created when the (experimental, unsupported) dedicated image optimization Lambda is enabled.
1727
+
1728
+ `_next/image` is otherwise served by
1729
+ {@link nextjsFunctions}.
1730
+
1731
+ ---
1732
+
1733
+
1734
+ ### NextjsImageFunction <a name="NextjsImageFunction" id="cdk-nextjs.NextjsImageFunction"></a>
1735
+
1736
+ Dedicated Lambda function for Next.js image optimization (`src/image-optimization/handler.mts`). Kept separate from the server function so image requests get a lightweight, natively-streaming zip Lambda instead of paying the Docker/Lambda Web Adapter cold-start cost.
1737
+
1738
+ #### Initializers <a name="Initializers" id="cdk-nextjs.NextjsImageFunction.Initializer"></a>
1739
+
1740
+ ```typescript
1741
+ import { NextjsImageFunction } from 'cdk-nextjs'
1742
+
1743
+ new NextjsImageFunction(scope: Construct, id: string, props: NextjsImageFunctionProps)
1744
+ ```
1745
+
1746
+ | **Name** | **Type** | **Description** |
1747
+ | --- | --- | --- |
1748
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
1749
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
1750
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.Initializer.parameter.props">props</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a></code> | *No description.* |
1751
+
1752
+ ---
1753
+
1754
+ ##### `scope`<sup>Required</sup> <a name="scope" id="cdk-nextjs.NextjsImageFunction.Initializer.parameter.scope"></a>
1755
+
1756
+ - *Type:* constructs.Construct
1757
+
1758
+ ---
1759
+
1760
+ ##### `id`<sup>Required</sup> <a name="id" id="cdk-nextjs.NextjsImageFunction.Initializer.parameter.id"></a>
1761
+
1762
+ - *Type:* string
1763
+
1764
+ ---
1765
+
1766
+ ##### `props`<sup>Required</sup> <a name="props" id="cdk-nextjs.NextjsImageFunction.Initializer.parameter.props"></a>
1767
+
1768
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a>
1769
+
1770
+ ---
1771
+
1772
+ #### Methods <a name="Methods" id="Methods"></a>
1773
+
1774
+ | **Name** | **Description** |
1775
+ | --- | --- |
1776
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.toString">toString</a></code> | Returns a string representation of this construct. |
1777
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.with">with</a></code> | Applies one or more mixins to this construct. |
1778
+
1779
+ ---
1780
+
1781
+ ##### `toString` <a name="toString" id="cdk-nextjs.NextjsImageFunction.toString"></a>
1782
+
1783
+ ```typescript
1784
+ public toString(): string
1785
+ ```
1786
+
1787
+ Returns a string representation of this construct.
1788
+
1789
+ ##### `with` <a name="with" id="cdk-nextjs.NextjsImageFunction.with"></a>
1790
+
1791
+ ```typescript
1792
+ public with(mixins: ...IMixin[]): IConstruct
1793
+ ```
1794
+
1795
+ Applies one or more mixins to this construct.
1796
+
1797
+ Mixins are applied in order. The list of constructs is captured at the
1798
+ start of the call, so constructs added by a mixin will not be visited.
1799
+ Use multiple `with()` calls if subsequent mixins should apply to added
1800
+ constructs.
1801
+
1802
+ ###### `mixins`<sup>Required</sup> <a name="mixins" id="cdk-nextjs.NextjsImageFunction.with.parameter.mixins"></a>
1803
+
1804
+ - *Type:* ...constructs.IMixin[]
1805
+
1806
+ The mixins to apply.
1807
+
1808
+ ---
1809
+
1810
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
1811
+
1812
+ | **Name** | **Description** |
1813
+ | --- | --- |
1814
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
1815
+
1816
+ ---
1817
+
1818
+ ##### `isConstruct` <a name="isConstruct" id="cdk-nextjs.NextjsImageFunction.isConstruct"></a>
1819
+
1820
+ ```typescript
1821
+ import { NextjsImageFunction } from 'cdk-nextjs'
1822
+
1823
+ NextjsImageFunction.isConstruct(x: any)
1824
+ ```
1825
+
1826
+ Checks if `x` is a construct.
1827
+
1828
+ Use this method instead of `instanceof` to properly detect `Construct`
1829
+ instances, even when the construct library is symlinked.
1830
+
1831
+ Explanation: in JavaScript, multiple copies of the `constructs` library on
1832
+ disk are seen as independent, completely different libraries. As a
1833
+ consequence, the class `Construct` in each copy of the `constructs` library
1834
+ is seen as a different class, and an instance of one class will not test as
1835
+ `instanceof` the other class. `npm install` will not create installations
1836
+ like this, but users may manually symlink construct libraries together or
1837
+ use a monorepo tool: in those cases, multiple copies of the `constructs`
1838
+ library can be accidentally installed, and `instanceof` will behave
1839
+ unpredictably. It is safest to avoid using `instanceof`, and using
1840
+ this type-testing method instead.
1841
+
1842
+ ###### `x`<sup>Required</sup> <a name="x" id="cdk-nextjs.NextjsImageFunction.isConstruct.parameter.x"></a>
1843
+
1844
+ - *Type:* any
1845
+
1846
+ Any object.
1847
+
1848
+ ---
1849
+
1850
+ #### Properties <a name="Properties" id="Properties"></a>
1851
+
1852
+ | **Name** | **Type** | **Description** |
1853
+ | --- | --- | --- |
1854
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
1855
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.property.function">function</a></code> | <code>aws-cdk-lib.aws_lambda.Function</code> | *No description.* |
1856
+ | <code><a href="#cdk-nextjs.NextjsImageFunction.property.functionUrl">functionUrl</a></code> | <code>aws-cdk-lib.aws_lambda.FunctionUrl</code> | *No description.* |
1857
+
1858
+ ---
1859
+
1860
+ ##### `node`<sup>Required</sup> <a name="node" id="cdk-nextjs.NextjsImageFunction.property.node"></a>
1861
+
1862
+ ```typescript
1863
+ public readonly node: Node;
1864
+ ```
1865
+
1866
+ - *Type:* constructs.Node
1867
+
1868
+ The tree node.
1869
+
1870
+ ---
1871
+
1872
+ ##### `function`<sup>Required</sup> <a name="function" id="cdk-nextjs.NextjsImageFunction.property.function"></a>
1873
+
1874
+ ```typescript
1875
+ public readonly function: Function;
1876
+ ```
1877
+
1878
+ - *Type:* aws-cdk-lib.aws_lambda.Function
1879
+
1880
+ ---
1881
+
1882
+ ##### `functionUrl`<sup>Optional</sup> <a name="functionUrl" id="cdk-nextjs.NextjsImageFunction.property.functionUrl"></a>
1883
+
1884
+ ```typescript
1885
+ public readonly functionUrl: FunctionUrl;
1886
+ ```
1887
+
1888
+ - *Type:* aws-cdk-lib.aws_lambda.FunctionUrl
1889
+
1890
+ ---
1891
+
1704
1892
 
1705
1893
  ### NextjsPostDeploy <a name="NextjsPostDeploy" id="cdk-nextjs.NextjsPostDeploy"></a>
1706
1894
 
@@ -2198,6 +2386,7 @@ Any object.
2198
2386
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctions.property.nextjsApi">nextjsApi</a></code> | <code><a href="#cdk-nextjs.NextjsApi">NextjsApi</a></code> | *No description.* |
2199
2387
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctions.property.nextjsFunctions">nextjsFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsFunctions">NextjsFunctions</a></code> | *No description.* |
2200
2388
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctions.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a></code> | *No description.* |
2389
+ | <code><a href="#cdk-nextjs.NextjsRegionalFunctions.property.nextjsImageFunction">nextjsImageFunction</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunction">NextjsImageFunction</a></code> | Only created when the (experimental, unsupported) dedicated image optimization Lambda is enabled. |
2201
2390
 
2202
2391
  ---
2203
2392
 
@@ -2283,6 +2472,21 @@ public readonly nextjsPostDeploy: NextjsPostDeploy;
2283
2472
 
2284
2473
  ---
2285
2474
 
2475
+ ##### `nextjsImageFunction`<sup>Optional</sup> <a name="nextjsImageFunction" id="cdk-nextjs.NextjsRegionalFunctions.property.nextjsImageFunction"></a>
2476
+
2477
+ ```typescript
2478
+ public readonly nextjsImageFunction: NextjsImageFunction;
2479
+ ```
2480
+
2481
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunction">NextjsImageFunction</a>
2482
+
2483
+ Only created when the (experimental, unsupported) dedicated image optimization Lambda is enabled.
2484
+
2485
+ `_next/image` is otherwise served by
2486
+ {@link nextjsFunctions}.
2487
+
2488
+ ---
2489
+
2286
2490
 
2287
2491
  ### NextjsStaticAssets <a name="NextjsStaticAssets" id="cdk-nextjs.NextjsStaticAssets"></a>
2288
2492
 
@@ -2460,6 +2664,7 @@ const nextjsApiOverrides: NextjsApiOverrides = { ... }
2460
2664
  | **Name** | **Type** | **Description** |
2461
2665
  | --- | --- | --- |
2462
2666
  | <code><a href="#cdk-nextjs.NextjsApiOverrides.property.dynamicIntegrationProps">dynamicIntegrationProps</a></code> | <code>aws-cdk-lib.aws_apigateway.LambdaIntegrationOptions</code> | *No description.* |
2667
+ | <code><a href="#cdk-nextjs.NextjsApiOverrides.property.imageIntegrationProps">imageIntegrationProps</a></code> | <code>aws-cdk-lib.aws_apigateway.LambdaIntegrationOptions</code> | *No description.* |
2463
2668
  | <code><a href="#cdk-nextjs.NextjsApiOverrides.property.restApiProps">restApiProps</a></code> | <code>aws-cdk-lib.aws_apigateway.RestApiProps</code> | *No description.* |
2464
2669
  | <code><a href="#cdk-nextjs.NextjsApiOverrides.property.s3MethodOptions">s3MethodOptions</a></code> | <code>aws-cdk-lib.aws_apigateway.MethodOptions</code> | *No description.* |
2465
2670
  | <code><a href="#cdk-nextjs.NextjsApiOverrides.property.staticIntegrationProps">staticIntegrationProps</a></code> | <code>aws-cdk-lib.aws_apigateway.AwsIntegrationProps</code> | *No description.* |
@@ -2476,6 +2681,16 @@ public readonly dynamicIntegrationProps: LambdaIntegrationOptions;
2476
2681
 
2477
2682
  ---
2478
2683
 
2684
+ ##### `imageIntegrationProps`<sup>Optional</sup> <a name="imageIntegrationProps" id="cdk-nextjs.NextjsApiOverrides.property.imageIntegrationProps"></a>
2685
+
2686
+ ```typescript
2687
+ public readonly imageIntegrationProps: LambdaIntegrationOptions;
2688
+ ```
2689
+
2690
+ - *Type:* aws-cdk-lib.aws_apigateway.LambdaIntegrationOptions
2691
+
2692
+ ---
2693
+
2479
2694
  ##### `restApiProps`<sup>Optional</sup> <a name="restApiProps" id="cdk-nextjs.NextjsApiOverrides.property.restApiProps"></a>
2480
2695
 
2481
2696
  ```typescript
@@ -2523,6 +2738,7 @@ const nextjsApiProps: NextjsApiProps = { ... }
2523
2738
  | <code><a href="#cdk-nextjs.NextjsApiProps.property.publicDirEntries">publicDirEntries</a></code> | <code><a href="#cdk-nextjs.PublicDirEntry">PublicDirEntry</a>[]</code> | Path to directory of Next.js app's public directory. Used to add resources to API Gateway REST API for public directory to go directly to S3. |
2524
2739
  | <code><a href="#cdk-nextjs.NextjsApiProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.IBucket</code> | The S3 bucket containing static assets. |
2525
2740
  | <code><a href="#cdk-nextjs.NextjsApiProps.property.basePath">basePath</a></code> | <code>string</code> | Optional base path for the application. |
2741
+ | <code><a href="#cdk-nextjs.NextjsApiProps.property.imageFunction">imageFunction</a></code> | <code>aws-cdk-lib.aws_lambda.IFunction</code> | Dedicated image optimization Lambda for the `_next/image` route. |
2526
2742
  | <code><a href="#cdk-nextjs.NextjsApiProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsApiOverrides">NextjsApiOverrides</a></code> | Override props for every construct. |
2527
2743
  | <code><a href="#cdk-nextjs.NextjsApiProps.property.serverFunction">serverFunction</a></code> | <code>aws-cdk-lib.aws_lambda.IFunction</code> | Required if `NextjsRegionalFunctions`. |
2528
2744
  | <code><a href="#cdk-nextjs.NextjsApiProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | [Future] Required if `NextjsRegionalContainers`. |
@@ -2565,6 +2781,29 @@ Optional base path for the application.
2565
2781
 
2566
2782
  ---
2567
2783
 
2784
+ ##### `imageFunction`<sup>Optional</sup> <a name="imageFunction" id="cdk-nextjs.NextjsApiProps.property.imageFunction"></a>
2785
+
2786
+ ```typescript
2787
+ public readonly imageFunction: IFunction;
2788
+ ```
2789
+
2790
+ - *Type:* aws-cdk-lib.aws_lambda.IFunction
2791
+
2792
+ Dedicated image optimization Lambda for the `_next/image` route.
2793
+
2794
+ When
2795
+ omitted, no `_next/image` resource is created and those requests fall
2796
+ through to `serverFunction` via the `{proxy+}` catch-all.
2797
+
2798
+ When provided, it is assumed to support Lambda response streaming (as the
2799
+ dedicated image Lambda this package builds does) and is invoked with
2800
+ `ResponseTransferMode.STREAM` accordingly. If you supply a custom
2801
+ `imageFunction` that doesn't support streaming, override
2802
+ `responseTransferMode` to `BUFFERED` via `overrides.imageIntegrationProps`,
2803
+ otherwise API Gateway returns a 502.
2804
+
2805
+ ---
2806
+
2568
2807
  ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsApiProps.property.overrides"></a>
2569
2808
 
2570
2809
  ```typescript
@@ -3638,6 +3877,7 @@ const nextjsDistributionOverrides: NextjsDistributionOverrides = { ... }
3638
3877
  | <code><a href="#cdk-nextjs.NextjsDistributionOverrides.property.dynamicVpcOriginWithEndpointProps">dynamicVpcOriginWithEndpointProps</a></code> | <code>aws-cdk-lib.aws_cloudfront_origins.VpcOriginWithEndpointProps</code> | *No description.* |
3639
3878
  | <code><a href="#cdk-nextjs.NextjsDistributionOverrides.property.imageBehaviorOptions">imageBehaviorOptions</a></code> | <code>aws-cdk-lib.aws_cloudfront.AddBehaviorOptions</code> | *No description.* |
3640
3879
  | <code><a href="#cdk-nextjs.NextjsDistributionOverrides.property.imageCachePolicyProps">imageCachePolicyProps</a></code> | <code>aws-cdk-lib.aws_cloudfront.CachePolicyProps</code> | *No description.* |
3880
+ | <code><a href="#cdk-nextjs.NextjsDistributionOverrides.property.imageFunctionUrlOriginWithOACProps">imageFunctionUrlOriginWithOACProps</a></code> | <code>aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOriginWithOACProps</code> | *No description.* |
3641
3881
  | <code><a href="#cdk-nextjs.NextjsDistributionOverrides.property.imageResponseHeadersPolicyProps">imageResponseHeadersPolicyProps</a></code> | <code>aws-cdk-lib.aws_cloudfront.ResponseHeadersPolicyProps</code> | *No description.* |
3642
3882
  | <code><a href="#cdk-nextjs.NextjsDistributionOverrides.property.s3BucketOriginProps">s3BucketOriginProps</a></code> | <code><a href="#cdk-nextjs.OptionalS3OriginBucketWithOACProps">OptionalS3OriginBucketWithOACProps</a></code> | *No description.* |
3643
3883
  | <code><a href="#cdk-nextjs.NextjsDistributionOverrides.property.staticBehaviorOptions">staticBehaviorOptions</a></code> | <code>aws-cdk-lib.aws_cloudfront.AddBehaviorOptions</code> | *No description.* |
@@ -3725,6 +3965,16 @@ public readonly imageCachePolicyProps: CachePolicyProps;
3725
3965
 
3726
3966
  ---
3727
3967
 
3968
+ ##### `imageFunctionUrlOriginWithOACProps`<sup>Optional</sup> <a name="imageFunctionUrlOriginWithOACProps" id="cdk-nextjs.NextjsDistributionOverrides.property.imageFunctionUrlOriginWithOACProps"></a>
3969
+
3970
+ ```typescript
3971
+ public readonly imageFunctionUrlOriginWithOACProps: FunctionUrlOriginWithOACProps;
3972
+ ```
3973
+
3974
+ - *Type:* aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOriginWithOACProps
3975
+
3976
+ ---
3977
+
3728
3978
  ##### `imageResponseHeadersPolicyProps`<sup>Optional</sup> <a name="imageResponseHeadersPolicyProps" id="cdk-nextjs.NextjsDistributionOverrides.property.imageResponseHeadersPolicyProps"></a>
3729
3979
 
3730
3980
  ```typescript
@@ -3786,6 +4036,7 @@ const nextjsDistributionProps: NextjsDistributionProps = { ... }
3786
4036
  | <code><a href="#cdk-nextjs.NextjsDistributionProps.property.certificate">certificate</a></code> | <code>aws-cdk-lib.aws_certificatemanager.ICertificate</code> | Optional but only applicable for `NextjsType.GLOBAL_CONTAINERS`. |
3787
4037
  | <code><a href="#cdk-nextjs.NextjsDistributionProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.Distribution</code> | *No description.* |
3788
4038
  | <code><a href="#cdk-nextjs.NextjsDistributionProps.property.functionUrl">functionUrl</a></code> | <code>aws-cdk-lib.aws_lambda.IFunctionUrl</code> | Required if `NextjsType.GLOBAL_FUNCTIONS`. |
4039
+ | <code><a href="#cdk-nextjs.NextjsDistributionProps.property.imageFunctionUrl">imageFunctionUrl</a></code> | <code>aws-cdk-lib.aws_lambda.IFunctionUrl</code> | Function URL of the dedicated image optimization Lambda. |
3789
4040
  | <code><a href="#cdk-nextjs.NextjsDistributionProps.property.loadBalancer">loadBalancer</a></code> | <code>aws-cdk-lib.aws_elasticloadbalancingv2.IApplicationLoadBalancer</code> | Required if `NextjsType.GLOBAL_CONTAINERS` or `NextjsType.REGIONAL_CONTAINERS`. |
3790
4041
  | <code><a href="#cdk-nextjs.NextjsDistributionProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsDistributionOverrides">NextjsDistributionOverrides</a></code> | Override props for every construct. |
3791
4042
 
@@ -3871,6 +4122,24 @@ Required if `NextjsType.GLOBAL_FUNCTIONS`.
3871
4122
 
3872
4123
  ---
3873
4124
 
4125
+ ##### `imageFunctionUrl`<sup>Optional</sup> <a name="imageFunctionUrl" id="cdk-nextjs.NextjsDistributionProps.property.imageFunctionUrl"></a>
4126
+
4127
+ ```typescript
4128
+ public readonly imageFunctionUrl: IFunctionUrl;
4129
+ ```
4130
+
4131
+ - *Type:* aws-cdk-lib.aws_lambda.IFunctionUrl
4132
+
4133
+ Function URL of the dedicated image optimization Lambda.
4134
+
4135
+ Only applicable
4136
+ to `NextjsType.GLOBAL_FUNCTIONS`, and only when the dedicated image
4137
+ function is enabled. When omitted, the `_next/image*` behavior points at
4138
+ the dynamic origin, which serves image optimization from the Next.js
4139
+ server itself.
4140
+
4141
+ ---
4142
+
3874
4143
  ##### `loadBalancer`<sup>Optional</sup> <a name="loadBalancer" id="cdk-nextjs.NextjsDistributionProps.property.loadBalancer"></a>
3875
4144
 
3876
4145
  ```typescript
@@ -3895,6 +4164,84 @@ Override props for every construct.
3895
4164
 
3896
4165
  ---
3897
4166
 
4167
+ ### NextjsFunctionsConstructOverrides <a name="NextjsFunctionsConstructOverrides" id="cdk-nextjs.NextjsFunctionsConstructOverrides"></a>
4168
+
4169
+ Adds the overrides that only apply to the two Functions `NextjsType`s.
4170
+
4171
+ The
4172
+ Containers types serve `_next/image` from the standalone server itself and
4173
+ have no Lambda functions to configure, so they would silently ignore these.
4174
+
4175
+ #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsFunctionsConstructOverrides.Initializer"></a>
4176
+
4177
+ ```typescript
4178
+ import { NextjsFunctionsConstructOverrides } from 'cdk-nextjs'
4179
+
4180
+ const nextjsFunctionsConstructOverrides: NextjsFunctionsConstructOverrides = { ... }
4181
+ ```
4182
+
4183
+ #### Properties <a name="Properties" id="Properties"></a>
4184
+
4185
+ | **Name** | **Type** | **Description** |
4186
+ | --- | --- | --- |
4187
+ | <code><a href="#cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsBuildProps">nextjsBuildProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a></code> | *No description.* |
4188
+ | <code><a href="#cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsCacheProps">nextjsCacheProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsCacheProps">OptionalNextjsCacheProps</a></code> | *No description.* |
4189
+ | <code><a href="#cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsStaticAssetsProps">nextjsStaticAssetsProps</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsProps">NextjsStaticAssetsProps</a></code> | *No description.* |
4190
+ | <code><a href="#cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsFunctionsProps">nextjsFunctionsProps</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a></code> | *No description.* |
4191
+ | <code><a href="#cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsImageFunctionProps">nextjsImageFunctionProps</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a></code> | *No description.* |
4192
+
4193
+ ---
4194
+
4195
+ ##### `nextjsBuildProps`<sup>Optional</sup> <a name="nextjsBuildProps" id="cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsBuildProps"></a>
4196
+
4197
+ ```typescript
4198
+ public readonly nextjsBuildProps: OptionalNextjsBuildProps;
4199
+ ```
4200
+
4201
+ - *Type:* <a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a>
4202
+
4203
+ ---
4204
+
4205
+ ##### `nextjsCacheProps`<sup>Optional</sup> <a name="nextjsCacheProps" id="cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsCacheProps"></a>
4206
+
4207
+ ```typescript
4208
+ public readonly nextjsCacheProps: OptionalNextjsCacheProps;
4209
+ ```
4210
+
4211
+ - *Type:* <a href="#cdk-nextjs.OptionalNextjsCacheProps">OptionalNextjsCacheProps</a>
4212
+
4213
+ ---
4214
+
4215
+ ##### `nextjsStaticAssetsProps`<sup>Optional</sup> <a name="nextjsStaticAssetsProps" id="cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsStaticAssetsProps"></a>
4216
+
4217
+ ```typescript
4218
+ public readonly nextjsStaticAssetsProps: NextjsStaticAssetsProps;
4219
+ ```
4220
+
4221
+ - *Type:* <a href="#cdk-nextjs.NextjsStaticAssetsProps">NextjsStaticAssetsProps</a>
4222
+
4223
+ ---
4224
+
4225
+ ##### `nextjsFunctionsProps`<sup>Optional</sup> <a name="nextjsFunctionsProps" id="cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsFunctionsProps"></a>
4226
+
4227
+ ```typescript
4228
+ public readonly nextjsFunctionsProps: NextjsFunctionsProps;
4229
+ ```
4230
+
4231
+ - *Type:* <a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a>
4232
+
4233
+ ---
4234
+
4235
+ ##### `nextjsImageFunctionProps`<sup>Optional</sup> <a name="nextjsImageFunctionProps" id="cdk-nextjs.NextjsFunctionsConstructOverrides.property.nextjsImageFunctionProps"></a>
4236
+
4237
+ ```typescript
4238
+ public readonly nextjsImageFunctionProps: NextjsImageFunctionProps;
4239
+ ```
4240
+
4241
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a>
4242
+
4243
+ ---
4244
+
3898
4245
  ### NextjsFunctionsOverrides <a name="NextjsFunctionsOverrides" id="cdk-nextjs.NextjsFunctionsOverrides"></a>
3899
4246
 
3900
4247
  #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsFunctionsOverrides.Initializer"></a>
@@ -4496,8 +4843,9 @@ const nextjsGlobalFunctionsConstructOverrides: NextjsGlobalFunctionsConstructOve
4496
4843
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsBuildProps">nextjsBuildProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a></code> | *No description.* |
4497
4844
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsCacheProps">nextjsCacheProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsCacheProps">OptionalNextjsCacheProps</a></code> | *No description.* |
4498
4845
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsStaticAssetsProps">nextjsStaticAssetsProps</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsProps">NextjsStaticAssetsProps</a></code> | *No description.* |
4499
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsDistributionProps">nextjsDistributionProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps">OptionalNextjsDistributionProps</a></code> | *No description.* |
4500
4846
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsFunctionsProps">nextjsFunctionsProps</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a></code> | *No description.* |
4847
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsImageFunctionProps">nextjsImageFunctionProps</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a></code> | *No description.* |
4848
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsDistributionProps">nextjsDistributionProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps">OptionalNextjsDistributionProps</a></code> | *No description.* |
4501
4849
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsPostDeployProps">nextjsPostDeployProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a></code> | *No description.* |
4502
4850
 
4503
4851
  ---
@@ -4532,23 +4880,33 @@ public readonly nextjsStaticAssetsProps: NextjsStaticAssetsProps;
4532
4880
 
4533
4881
  ---
4534
4882
 
4535
- ##### `nextjsDistributionProps`<sup>Optional</sup> <a name="nextjsDistributionProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsDistributionProps"></a>
4883
+ ##### `nextjsFunctionsProps`<sup>Optional</sup> <a name="nextjsFunctionsProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsFunctionsProps"></a>
4536
4884
 
4537
4885
  ```typescript
4538
- public readonly nextjsDistributionProps: OptionalNextjsDistributionProps;
4886
+ public readonly nextjsFunctionsProps: NextjsFunctionsProps;
4539
4887
  ```
4540
4888
 
4541
- - *Type:* <a href="#cdk-nextjs.OptionalNextjsDistributionProps">OptionalNextjsDistributionProps</a>
4889
+ - *Type:* <a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a>
4542
4890
 
4543
4891
  ---
4544
4892
 
4545
- ##### `nextjsFunctionsProps`<sup>Optional</sup> <a name="nextjsFunctionsProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsFunctionsProps"></a>
4893
+ ##### `nextjsImageFunctionProps`<sup>Optional</sup> <a name="nextjsImageFunctionProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsImageFunctionProps"></a>
4546
4894
 
4547
4895
  ```typescript
4548
- public readonly nextjsFunctionsProps: NextjsFunctionsProps;
4896
+ public readonly nextjsImageFunctionProps: NextjsImageFunctionProps;
4549
4897
  ```
4550
4898
 
4551
- - *Type:* <a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a>
4899
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a>
4900
+
4901
+ ---
4902
+
4903
+ ##### `nextjsDistributionProps`<sup>Optional</sup> <a name="nextjsDistributionProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsDistributionProps"></a>
4904
+
4905
+ ```typescript
4906
+ public readonly nextjsDistributionProps: OptionalNextjsDistributionProps;
4907
+ ```
4908
+
4909
+ - *Type:* <a href="#cdk-nextjs.OptionalNextjsDistributionProps">OptionalNextjsDistributionProps</a>
4552
4910
 
4553
4911
  ---
4554
4912
 
@@ -4587,6 +4945,7 @@ const nextjsGlobalFunctionsOverrides: NextjsGlobalFunctionsOverrides = { ... }
4587
4945
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsDistribution">nextjsDistribution</a></code> | <code><a href="#cdk-nextjs.NextjsDistributionOverrides">NextjsDistributionOverrides</a></code> | *No description.* |
4588
4946
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsFunctions">nextjsFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsOverrides">NextjsFunctionsOverrides</a></code> | *No description.* |
4589
4947
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsGlobalFunctions">nextjsGlobalFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides">NextjsGlobalFunctionsConstructOverrides</a></code> | *No description.* |
4948
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsImageFunction">nextjsImageFunction</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunctionOverrides">NextjsImageFunctionOverrides</a></code> | *No description.* |
4590
4949
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | *No description.* |
4591
4950
 
4592
4951
  ---
@@ -4641,6 +5000,16 @@ public readonly nextjsGlobalFunctions: NextjsGlobalFunctionsConstructOverrides;
4641
5000
 
4642
5001
  ---
4643
5002
 
5003
+ ##### `nextjsImageFunction`<sup>Optional</sup> <a name="nextjsImageFunction" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsImageFunction"></a>
5004
+
5005
+ ```typescript
5006
+ public readonly nextjsImageFunction: NextjsImageFunctionOverrides;
5007
+ ```
5008
+
5009
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunctionOverrides">NextjsImageFunctionOverrides</a>
5010
+
5011
+ ---
5012
+
4644
5013
  ##### `nextjsPostDeploy`<sup>Optional</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsPostDeploy"></a>
4645
5014
 
4646
5015
  ```typescript
@@ -4864,6 +5233,125 @@ Override props of any construct.
4864
5233
 
4865
5234
  ---
4866
5235
 
5236
+ ### NextjsImageFunctionOverrides <a name="NextjsImageFunctionOverrides" id="cdk-nextjs.NextjsImageFunctionOverrides"></a>
5237
+
5238
+ #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsImageFunctionOverrides.Initializer"></a>
5239
+
5240
+ ```typescript
5241
+ import { NextjsImageFunctionOverrides } from 'cdk-nextjs'
5242
+
5243
+ const nextjsImageFunctionOverrides: NextjsImageFunctionOverrides = { ... }
5244
+ ```
5245
+
5246
+ #### Properties <a name="Properties" id="Properties"></a>
5247
+
5248
+ | **Name** | **Type** | **Description** |
5249
+ | --- | --- | --- |
5250
+ | <code><a href="#cdk-nextjs.NextjsImageFunctionOverrides.property.functionProps">functionProps</a></code> | <code><a href="#cdk-nextjs.OptionalFunctionProps">OptionalFunctionProps</a></code> | *No description.* |
5251
+ | <code><a href="#cdk-nextjs.NextjsImageFunctionOverrides.property.functionUrlProps">functionUrlProps</a></code> | <code><a href="#cdk-nextjs.OptionalFunctionUrlProps">OptionalFunctionUrlProps</a></code> | *No description.* |
5252
+
5253
+ ---
5254
+
5255
+ ##### `functionProps`<sup>Optional</sup> <a name="functionProps" id="cdk-nextjs.NextjsImageFunctionOverrides.property.functionProps"></a>
5256
+
5257
+ ```typescript
5258
+ public readonly functionProps: OptionalFunctionProps;
5259
+ ```
5260
+
5261
+ - *Type:* <a href="#cdk-nextjs.OptionalFunctionProps">OptionalFunctionProps</a>
5262
+
5263
+ ---
5264
+
5265
+ ##### `functionUrlProps`<sup>Optional</sup> <a name="functionUrlProps" id="cdk-nextjs.NextjsImageFunctionOverrides.property.functionUrlProps"></a>
5266
+
5267
+ ```typescript
5268
+ public readonly functionUrlProps: OptionalFunctionUrlProps;
5269
+ ```
5270
+
5271
+ - *Type:* <a href="#cdk-nextjs.OptionalFunctionUrlProps">OptionalFunctionUrlProps</a>
5272
+
5273
+ ---
5274
+
5275
+ ### NextjsImageFunctionProps <a name="NextjsImageFunctionProps" id="cdk-nextjs.NextjsImageFunctionProps"></a>
5276
+
5277
+ #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsImageFunctionProps.Initializer"></a>
5278
+
5279
+ ```typescript
5280
+ import { NextjsImageFunctionProps } from 'cdk-nextjs'
5281
+
5282
+ const nextjsImageFunctionProps: NextjsImageFunctionProps = { ... }
5283
+ ```
5284
+
5285
+ #### Properties <a name="Properties" id="Properties"></a>
5286
+
5287
+ | **Name** | **Type** | **Description** |
5288
+ | --- | --- | --- |
5289
+ | <code><a href="#cdk-nextjs.NextjsImageFunctionProps.property.imageOptimizationAssetPath">imageOptimizationAssetPath</a></code> | <code>string</code> | Absolute path to the asset prepared by `NextjsBuild`: bundled handler, glibc `sharp` binaries, and `required-server-files.json`. |
5290
+ | <code><a href="#cdk-nextjs.NextjsImageFunctionProps.property.nextjsType">nextjsType</a></code> | <code><a href="#cdk-nextjs.NextjsType">NextjsType</a></code> | *No description.* |
5291
+ | <code><a href="#cdk-nextjs.NextjsImageFunctionProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.IBucket</code> | S3 bucket containing static assets, read by the handler to serve non-absolute image URLs. |
5292
+ | <code><a href="#cdk-nextjs.NextjsImageFunctionProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunctionOverrides">NextjsImageFunctionOverrides</a></code> | Override props of any construct. |
5293
+ | <code><a href="#cdk-nextjs.NextjsImageFunctionProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
5294
+
5295
+ ---
5296
+
5297
+ ##### `imageOptimizationAssetPath`<sup>Required</sup> <a name="imageOptimizationAssetPath" id="cdk-nextjs.NextjsImageFunctionProps.property.imageOptimizationAssetPath"></a>
5298
+
5299
+ ```typescript
5300
+ public readonly imageOptimizationAssetPath: string;
5301
+ ```
5302
+
5303
+ - *Type:* string
5304
+
5305
+ Absolute path to the asset prepared by `NextjsBuild`: bundled handler, glibc `sharp` binaries, and `required-server-files.json`.
5306
+
5307
+ > [{@link NextjsBuild.imageOptimizationAssetPath }]({@link NextjsBuild.imageOptimizationAssetPath })
5308
+
5309
+ ---
5310
+
5311
+ ##### `nextjsType`<sup>Required</sup> <a name="nextjsType" id="cdk-nextjs.NextjsImageFunctionProps.property.nextjsType"></a>
5312
+
5313
+ ```typescript
5314
+ public readonly nextjsType: NextjsType;
5315
+ ```
5316
+
5317
+ - *Type:* <a href="#cdk-nextjs.NextjsType">NextjsType</a>
5318
+
5319
+ ---
5320
+
5321
+ ##### `staticAssetsBucket`<sup>Required</sup> <a name="staticAssetsBucket" id="cdk-nextjs.NextjsImageFunctionProps.property.staticAssetsBucket"></a>
5322
+
5323
+ ```typescript
5324
+ public readonly staticAssetsBucket: IBucket;
5325
+ ```
5326
+
5327
+ - *Type:* aws-cdk-lib.aws_s3.IBucket
5328
+
5329
+ S3 bucket containing static assets, read by the handler to serve non-absolute image URLs.
5330
+
5331
+ ---
5332
+
5333
+ ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsImageFunctionProps.property.overrides"></a>
5334
+
5335
+ ```typescript
5336
+ public readonly overrides: NextjsImageFunctionOverrides;
5337
+ ```
5338
+
5339
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunctionOverrides">NextjsImageFunctionOverrides</a>
5340
+
5341
+ Override props of any construct.
5342
+
5343
+ ---
5344
+
5345
+ ##### `vpc`<sup>Optional</sup> <a name="vpc" id="cdk-nextjs.NextjsImageFunctionProps.property.vpc"></a>
5346
+
5347
+ ```typescript
5348
+ public readonly vpc: IVpc;
5349
+ ```
5350
+
5351
+ - *Type:* aws-cdk-lib.aws_ec2.IVpc
5352
+
5353
+ ---
5354
+
4867
5355
  ### NextjsPostDeployOverrides <a name="NextjsPostDeployOverrides" id="cdk-nextjs.NextjsPostDeployOverrides"></a>
4868
5356
 
4869
5357
  #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsPostDeployOverrides.Initializer"></a>
@@ -5423,8 +5911,9 @@ const nextjsRegionalFunctionsConstructOverrides: NextjsRegionalFunctionsConstruc
5423
5911
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsBuildProps">nextjsBuildProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a></code> | *No description.* |
5424
5912
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsCacheProps">nextjsCacheProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsCacheProps">OptionalNextjsCacheProps</a></code> | *No description.* |
5425
5913
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsStaticAssetsProps">nextjsStaticAssetsProps</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsProps">NextjsStaticAssetsProps</a></code> | *No description.* |
5426
- | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsApiProps">nextjsApiProps</a></code> | <code><a href="#cdk-nextjs.NextjsApiProps">NextjsApiProps</a></code> | *No description.* |
5427
5914
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsFunctionsProps">nextjsFunctionsProps</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a></code> | *No description.* |
5915
+ | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsImageFunctionProps">nextjsImageFunctionProps</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a></code> | *No description.* |
5916
+ | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsApiProps">nextjsApiProps</a></code> | <code><a href="#cdk-nextjs.NextjsApiProps">NextjsApiProps</a></code> | *No description.* |
5428
5917
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsPostDeployProps">nextjsPostDeployProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a></code> | *No description.* |
5429
5918
 
5430
5919
  ---
@@ -5459,23 +5948,33 @@ public readonly nextjsStaticAssetsProps: NextjsStaticAssetsProps;
5459
5948
 
5460
5949
  ---
5461
5950
 
5462
- ##### `nextjsApiProps`<sup>Optional</sup> <a name="nextjsApiProps" id="cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsApiProps"></a>
5951
+ ##### `nextjsFunctionsProps`<sup>Optional</sup> <a name="nextjsFunctionsProps" id="cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsFunctionsProps"></a>
5463
5952
 
5464
5953
  ```typescript
5465
- public readonly nextjsApiProps: NextjsApiProps;
5954
+ public readonly nextjsFunctionsProps: NextjsFunctionsProps;
5466
5955
  ```
5467
5956
 
5468
- - *Type:* <a href="#cdk-nextjs.NextjsApiProps">NextjsApiProps</a>
5957
+ - *Type:* <a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a>
5469
5958
 
5470
5959
  ---
5471
5960
 
5472
- ##### `nextjsFunctionsProps`<sup>Optional</sup> <a name="nextjsFunctionsProps" id="cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsFunctionsProps"></a>
5961
+ ##### `nextjsImageFunctionProps`<sup>Optional</sup> <a name="nextjsImageFunctionProps" id="cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsImageFunctionProps"></a>
5473
5962
 
5474
5963
  ```typescript
5475
- public readonly nextjsFunctionsProps: NextjsFunctionsProps;
5964
+ public readonly nextjsImageFunctionProps: NextjsImageFunctionProps;
5476
5965
  ```
5477
5966
 
5478
- - *Type:* <a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a>
5967
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunctionProps">NextjsImageFunctionProps</a>
5968
+
5969
+ ---
5970
+
5971
+ ##### `nextjsApiProps`<sup>Optional</sup> <a name="nextjsApiProps" id="cdk-nextjs.NextjsRegionalFunctionsConstructOverrides.property.nextjsApiProps"></a>
5972
+
5973
+ ```typescript
5974
+ public readonly nextjsApiProps: NextjsApiProps;
5975
+ ```
5976
+
5977
+ - *Type:* <a href="#cdk-nextjs.NextjsApiProps">NextjsApiProps</a>
5479
5978
 
5480
5979
  ---
5481
5980
 
@@ -5513,6 +6012,7 @@ const nextjsRegionalFunctionsOverrides: NextjsRegionalFunctionsOverrides = { ...
5513
6012
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsStaticAssets">nextjsStaticAssets</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsOverrides">NextjsStaticAssetsOverrides</a></code> | *No description.* |
5514
6013
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsApi">nextjsApi</a></code> | <code><a href="#cdk-nextjs.NextjsApiOverrides">NextjsApiOverrides</a></code> | *No description.* |
5515
6014
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsFunctions">nextjsFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsOverrides">NextjsFunctionsOverrides</a></code> | *No description.* |
6015
+ | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsImageFunction">nextjsImageFunction</a></code> | <code><a href="#cdk-nextjs.NextjsImageFunctionOverrides">NextjsImageFunctionOverrides</a></code> | *No description.* |
5516
6016
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | *No description.* |
5517
6017
  | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsRegionalFunctions">nextjsRegionalFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsRegionalFunctionsConstructOverrides">NextjsRegionalFunctionsConstructOverrides</a></code> | *No description.* |
5518
6018
 
@@ -5558,6 +6058,16 @@ public readonly nextjsFunctions: NextjsFunctionsOverrides;
5558
6058
 
5559
6059
  ---
5560
6060
 
6061
+ ##### `nextjsImageFunction`<sup>Optional</sup> <a name="nextjsImageFunction" id="cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsImageFunction"></a>
6062
+
6063
+ ```typescript
6064
+ public readonly nextjsImageFunction: NextjsImageFunctionOverrides;
6065
+ ```
6066
+
6067
+ - *Type:* <a href="#cdk-nextjs.NextjsImageFunctionOverrides">NextjsImageFunctionOverrides</a>
6068
+
6069
+ ---
6070
+
5561
6071
  ##### `nextjsPostDeploy`<sup>Optional</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsRegionalFunctionsOverrides.property.nextjsPostDeploy"></a>
5562
6072
 
5563
6073
  ```typescript
@@ -10393,6 +10903,7 @@ const optionalNextjsDistributionProps: OptionalNextjsDistributionProps = { ... }
10393
10903
  | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.certificate">certificate</a></code> | <code>aws-cdk-lib.aws_certificatemanager.ICertificate</code> | Optional but only applicable for `NextjsType.GLOBAL_CONTAINERS`. |
10394
10904
  | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.Distribution</code> | *No description.* |
10395
10905
  | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.functionUrl">functionUrl</a></code> | <code>aws-cdk-lib.aws_lambda.IFunctionUrl</code> | Required if `NextjsType.GLOBAL_FUNCTIONS`. |
10906
+ | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.imageFunctionUrl">imageFunctionUrl</a></code> | <code>aws-cdk-lib.aws_lambda.IFunctionUrl</code> | Function URL of the dedicated image optimization Lambda. |
10396
10907
  | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.loadBalancer">loadBalancer</a></code> | <code>aws-cdk-lib.aws_elasticloadbalancingv2.IApplicationLoadBalancer</code> | Required if `NextjsType.GLOBAL_CONTAINERS` or `NextjsType.REGIONAL_CONTAINERS`. |
10397
10908
  | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.nextjsType">nextjsType</a></code> | <code><a href="#cdk-nextjs.NextjsType">NextjsType</a></code> | *No description.* |
10398
10909
  | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.publicDirEntries">publicDirEntries</a></code> | <code><a href="#cdk-nextjs.PublicDirEntry">PublicDirEntry</a>[]</code> | Entries (files/directories) within Next.js app's public directory. Used to add static behaviors to distribution. |
@@ -10457,6 +10968,24 @@ Required if `NextjsType.GLOBAL_FUNCTIONS`.
10457
10968
 
10458
10969
  ---
10459
10970
 
10971
+ ##### `imageFunctionUrl`<sup>Optional</sup> <a name="imageFunctionUrl" id="cdk-nextjs.OptionalNextjsDistributionProps.property.imageFunctionUrl"></a>
10972
+
10973
+ ```typescript
10974
+ public readonly imageFunctionUrl: IFunctionUrl;
10975
+ ```
10976
+
10977
+ - *Type:* aws-cdk-lib.aws_lambda.IFunctionUrl
10978
+
10979
+ Function URL of the dedicated image optimization Lambda.
10980
+
10981
+ Only applicable
10982
+ to `NextjsType.GLOBAL_FUNCTIONS`, and only when the dedicated image
10983
+ function is enabled. When omitted, the `_next/image*` behavior points at
10984
+ the dynamic origin, which serves image optimization from the Next.js
10985
+ server itself.
10986
+
10987
+ ---
10988
+
10460
10989
  ##### `loadBalancer`<sup>Optional</sup> <a name="loadBalancer" id="cdk-nextjs.OptionalNextjsDistributionProps.property.loadBalancer"></a>
10461
10990
 
10462
10991
  ```typescript