cdk-nextjs 0.3.11 → 0.4.1

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 (106) hide show
  1. package/.jsii +1248 -748
  2. package/API.md +1033 -531
  3. package/README.md +1 -2
  4. package/assets/lambdas/assets-deployment/assets-deployment.lambda/assets-deployment.Dockerfile +12 -8
  5. package/assets/lambdas/assets-deployment/assets-deployment.lambda/index.js +67 -56
  6. package/assets/lambdas/post-deploy/post-deploy.lambda/index.js +246 -0
  7. package/docs/breaking-changes.md +9 -0
  8. package/docs/notes.md +170 -20
  9. package/lib/constants.d.ts +32 -0
  10. package/lib/constants.js +38 -0
  11. package/lib/generated-structs/OptionalCustomResourceProps.d.ts +104 -0
  12. package/lib/generated-structs/OptionalCustomResourceProps.js +3 -0
  13. package/lib/generated-structs/OptionalDockerImageAssetProps.d.ts +21 -0
  14. package/lib/generated-structs/OptionalDockerImageAssetProps.js +1 -1
  15. package/lib/generated-structs/OptionalNextjsAssetsDeploymentProps.d.ts +4 -3
  16. package/lib/generated-structs/OptionalNextjsAssetsDeploymentProps.js +1 -1
  17. package/lib/generated-structs/OptionalNextjsBuildProps.d.ts +1 -1
  18. package/lib/generated-structs/OptionalNextjsBuildProps.js +1 -1
  19. package/lib/generated-structs/OptionalNextjsContainersProps.d.ts +3 -3
  20. package/lib/generated-structs/OptionalNextjsContainersProps.js +1 -1
  21. package/lib/generated-structs/OptionalNextjsPostDeployProps.d.ts +42 -0
  22. package/lib/generated-structs/OptionalNextjsPostDeployProps.js +3 -0
  23. package/lib/generated-structs/OptionalPostDeployCustomResourceProperties.d.ts +41 -0
  24. package/lib/generated-structs/OptionalPostDeployCustomResourceProperties.js +4 -0
  25. package/lib/index.d.ts +6 -5
  26. package/lib/index.js +6 -8
  27. package/lib/lambdas/assets-deployment/assets-deployment.lambda.js +5 -23
  28. package/lib/lambdas/assets-deployment/fs-to-fs.js +18 -3
  29. package/lib/lambdas/assets-deployment/fs-to-s3.d.ts +8 -2
  30. package/lib/lambdas/assets-deployment/fs-to-s3.js +14 -8
  31. package/lib/lambdas/post-deploy/create-invalidation.d.ts +2 -0
  32. package/lib/lambdas/post-deploy/create-invalidation.js +19 -0
  33. package/lib/lambdas/post-deploy/post-deploy-function.d.ts +13 -0
  34. package/lib/lambdas/post-deploy/post-deploy-function.js +22 -0
  35. package/lib/lambdas/post-deploy/post-deploy.lambda.d.ts +9 -0
  36. package/lib/lambdas/post-deploy/post-deploy.lambda.js +56 -0
  37. package/lib/lambdas/post-deploy/prune-fs.d.ts +10 -0
  38. package/lib/lambdas/post-deploy/prune-fs.js +33 -0
  39. package/lib/lambdas/post-deploy/prune-s3.d.ts +15 -0
  40. package/lib/lambdas/post-deploy/prune-s3.js +101 -0
  41. package/lib/lambdas/utils.js +35 -0
  42. package/lib/nextjs-assets-deployment.d.ts +15 -51
  43. package/lib/nextjs-assets-deployment.js +27 -25
  44. package/lib/nextjs-build/builder.Dockerfile +12 -8
  45. package/lib/nextjs-build/cdk-nextjs-cache-handler.cjs +63 -0
  46. package/lib/nextjs-build/cdk-nextjs-cache-handler.d.ts +21 -0
  47. package/lib/nextjs-build/cdk-nextjs-cache-handler.js +49 -0
  48. package/lib/nextjs-build/global-containers.Dockerfile +29 -19
  49. package/lib/nextjs-build/global-functions.Dockerfile +30 -24
  50. package/lib/nextjs-build/nextjs-build.d.ts +51 -26
  51. package/lib/nextjs-build/nextjs-build.js +108 -88
  52. package/lib/nextjs-build/regional-containers.Dockerfile +30 -20
  53. package/lib/nextjs-compute/nextjs-compute-base-props.d.ts +0 -1
  54. package/lib/nextjs-compute/nextjs-compute-base-props.js +1 -1
  55. package/lib/nextjs-compute/nextjs-containers.d.ts +2 -1
  56. package/lib/nextjs-compute/nextjs-containers.js +7 -5
  57. package/lib/nextjs-compute/nextjs-functions.d.ts +1 -0
  58. package/lib/nextjs-compute/nextjs-functions.js +8 -11
  59. package/lib/nextjs-distribution.d.ts +1 -1
  60. package/lib/nextjs-distribution.js +4 -4
  61. package/lib/nextjs-file-system.js +1 -1
  62. package/lib/nextjs-post-deploy.d.ts +101 -0
  63. package/lib/nextjs-post-deploy.js +78 -0
  64. package/lib/nextjs-static-assets.js +1 -1
  65. package/lib/nextjs-vpc.d.ts +1 -1
  66. package/lib/nextjs-vpc.js +4 -4
  67. package/lib/root-constructs/nextjs-base-overrides.d.ts +4 -0
  68. package/lib/root-constructs/nextjs-base-overrides.js +1 -1
  69. package/lib/root-constructs/nextjs-base-props.d.ts +15 -7
  70. package/lib/root-constructs/nextjs-base-props.js +1 -1
  71. package/lib/root-constructs/nextjs-global-containers.d.ts +8 -8
  72. package/lib/root-constructs/nextjs-global-containers.js +25 -15
  73. package/lib/root-constructs/nextjs-global-functions.d.ts +8 -11
  74. package/lib/root-constructs/nextjs-global-functions.js +25 -25
  75. package/lib/root-constructs/nextjs-regional-containers.d.ts +8 -0
  76. package/lib/root-constructs/nextjs-regional-containers.js +26 -9
  77. package/lib/utils/get-architecture.d.ts +2 -0
  78. package/lib/utils/get-architecture.js +8 -0
  79. package/lib/utils/handle-deprecated-properties.d.ts +7 -0
  80. package/lib/utils/handle-deprecated-properties.js +14 -0
  81. package/package.json +17 -19
  82. package/assets/lambdas/revalidate/revalidate.lambda/index.js +0 -67
  83. package/lib/common.d.ts +0 -25
  84. package/lib/common.js +0 -30
  85. package/lib/generated-structs/OptionalNextjsInvalidationProps.d.ts +0 -11
  86. package/lib/generated-structs/OptionalNextjsInvalidationProps.js +0 -3
  87. package/lib/lambdas/assets-deployment/prune-s3.d.ts +0 -15
  88. package/lib/lambdas/assets-deployment/prune-s3.js +0 -42
  89. package/lib/lambdas/assets-deployment/s3.d.ts +0 -2
  90. package/lib/lambdas/assets-deployment/s3.js +0 -7
  91. package/lib/lambdas/assets-deployment/utils.js +0 -35
  92. package/lib/lambdas/revalidate/revalidate-function.d.ts +0 -13
  93. package/lib/lambdas/revalidate/revalidate-function.js +0 -22
  94. package/lib/lambdas/revalidate/revalidate.lambda.d.ts +0 -2
  95. package/lib/lambdas/revalidate/revalidate.lambda.js +0 -53
  96. package/lib/nextjs-build/add-cache-handler.d.ts +0 -1
  97. package/lib/nextjs-build/add-cache-handler.js +0 -23
  98. package/lib/nextjs-build/add-cache-handler.mjs +0 -18
  99. package/lib/nextjs-build/cache-handler.cjs +0 -21878
  100. package/lib/nextjs-build/cache-handler.d.ts +0 -6
  101. package/lib/nextjs-build/cache-handler.js +0 -26
  102. package/lib/nextjs-invalidation.d.ts +0 -19
  103. package/lib/nextjs-invalidation.js +0 -52
  104. package/lib/nextjs-revalidation.d.ts +0 -30
  105. package/lib/nextjs-revalidation.js +0 -65
  106. /package/lib/lambdas/{assets-deployment/utils.d.ts → utils.d.ts} +0 -0
package/API.md CHANGED
@@ -89,7 +89,6 @@ Any object.
89
89
  | <code><a href="#cdk-nextjs.NextjsAssetsDeployment.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
90
90
  | <code><a href="#cdk-nextjs.NextjsAssetsDeployment.property.customResource">customResource</a></code> | <code>aws-cdk-lib.CustomResource</code> | *No description.* |
91
91
  | <code><a href="#cdk-nextjs.NextjsAssetsDeployment.property.dockerImageFunction">dockerImageFunction</a></code> | <code>aws-cdk-lib.aws_lambda.DockerImageFunction</code> | *No description.* |
92
- | <code><a href="#cdk-nextjs.NextjsAssetsDeployment.property.previewModeId">previewModeId</a></code> | <code>string</code> | Only used for `NextjsGlobalFunctions`. |
93
92
 
94
93
  ---
95
94
 
@@ -125,18 +124,6 @@ public readonly dockerImageFunction: DockerImageFunction;
125
124
 
126
125
  ---
127
126
 
128
- ##### `previewModeId`<sup>Required</sup> <a name="previewModeId" id="cdk-nextjs.NextjsAssetsDeployment.property.previewModeId"></a>
129
-
130
- ```typescript
131
- public readonly previewModeId: string;
132
- ```
133
-
134
- - *Type:* string
135
-
136
- Only used for `NextjsGlobalFunctions`.
137
-
138
- ---
139
-
140
127
 
141
128
  ### NextjsBuild <a name="NextjsBuild" id="cdk-nextjs.NextjsBuild"></a>
142
129
 
@@ -225,8 +212,9 @@ Any object.
225
212
  | **Name** | **Type** | **Description** |
226
213
  | --- | --- | --- |
227
214
  | <code><a href="#cdk-nextjs.NextjsBuild.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
215
+ | <code><a href="#cdk-nextjs.NextjsBuild.property.builderImageAlias">builderImageAlias</a></code> | <code>string</code> | Image alias of builder image Next.js app which is built for other images to be built `FROM`. This image isn't built with CDK Assets construct b/c it doesn't need to be uploaded to ECR. We still need to include slice of `node.addr` in tag in case multiple cdk-nextjs constructs are used. |
216
+ | <code><a href="#cdk-nextjs.NextjsBuild.property.buildId">buildId</a></code> | <code>string</code> | Unique id for Next.js build. Used to partition EFS FileSystem. |
228
217
  | <code><a href="#cdk-nextjs.NextjsBuild.property.buildImageDigest">buildImageDigest</a></code> | <code>string</code> | Hash of builder image which will change whenever the image changes. |
229
- | <code><a href="#cdk-nextjs.NextjsBuild.property.containerMountPathForEfs">containerMountPathForEfs</a></code> | <code>string</code> | Mount path in container for EFS. Next.js image optimization, data, and full route cache will be symlinked to this location. |
230
218
  | <code><a href="#cdk-nextjs.NextjsBuild.property.imageForNextjsAssetsDeployment">imageForNextjsAssetsDeployment</a></code> | <code>aws-cdk-lib.aws_lambda.DockerImageCode</code> | Docker image built for `NextjsAssetsDeployment`. |
231
219
  | <code><a href="#cdk-nextjs.NextjsBuild.property.publicDirEntries">publicDirEntries</a></code> | <code><a href="#cdk-nextjs.PublicDirEntry">PublicDirEntry</a>[]</code> | Absolute path to public. |
232
220
  | <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. |
@@ -247,37 +235,43 @@ The tree node.
247
235
 
248
236
  ---
249
237
 
250
- ##### `buildImageDigest`<sup>Required</sup> <a name="buildImageDigest" id="cdk-nextjs.NextjsBuild.property.buildImageDigest"></a>
238
+ ##### `builderImageAlias`<sup>Required</sup> <a name="builderImageAlias" id="cdk-nextjs.NextjsBuild.property.builderImageAlias"></a>
251
239
 
252
240
  ```typescript
253
- public readonly buildImageDigest: string;
241
+ public readonly builderImageAlias: string;
254
242
  ```
255
243
 
256
244
  - *Type:* string
257
245
 
258
- Hash of builder image which will change whenever the image changes.
259
-
260
- Useful
261
- for passing to properties of custom resources that depend upon the builder
262
- image to re-run when build image changes.
246
+ Image alias of builder image Next.js app which is built for other images to be built `FROM`. This image isn't built with CDK Assets construct b/c it doesn't need to be uploaded to ECR. We still need to include slice of `node.addr` in tag in case multiple cdk-nextjs constructs are used.
263
247
 
264
248
  ---
265
249
 
266
- ##### `containerMountPathForEfs`<sup>Required</sup> <a name="containerMountPathForEfs" id="cdk-nextjs.NextjsBuild.property.containerMountPathForEfs"></a>
250
+ ##### `buildId`<sup>Required</sup> <a name="buildId" id="cdk-nextjs.NextjsBuild.property.buildId"></a>
267
251
 
268
252
  ```typescript
269
- public readonly containerMountPathForEfs: string;
253
+ public readonly buildId: string;
270
254
  ```
271
255
 
272
256
  - *Type:* string
273
257
 
274
- Mount path in container for EFS. Next.js image optimization, data, and full route cache will be symlinked to this location.
258
+ Unique id for Next.js build. Used to partition EFS FileSystem.
275
259
 
276
- Must comply with pattern: ^/mnt/[a-zA-Z0-9-_.]+$ due to lambda requirement.
277
- Fargate doesn't have this same requirement but we share code for lambda and
278
- fargate.
260
+ ---
261
+
262
+ ##### `buildImageDigest`<sup>Required</sup> <a name="buildImageDigest" id="cdk-nextjs.NextjsBuild.property.buildImageDigest"></a>
263
+
264
+ ```typescript
265
+ public readonly buildImageDigest: string;
266
+ ```
267
+
268
+ - *Type:* string
269
+
270
+ Hash of builder image which will change whenever the image changes.
279
271
 
280
- > [https://docs.aws.amazon.com/lambda/latest/api/API_FileSystemConfig.html](https://docs.aws.amazon.com/lambda/latest/api/API_FileSystemConfig.html)
272
+ Useful
273
+ for passing to properties of custom resources that depend upon the builder
274
+ image to re-run when build image changes.
281
275
 
282
276
  ---
283
277
 
@@ -951,7 +945,7 @@ Any object.
951
945
  | <code><a href="#cdk-nextjs.NextjsGlobalContainers.property.nextjsContainers">nextjsContainers</a></code> | <code><a href="#cdk-nextjs.NextjsContainers">NextjsContainers</a></code> | *No description.* |
952
946
  | <code><a href="#cdk-nextjs.NextjsGlobalContainers.property.nextjsDistribution">nextjsDistribution</a></code> | <code><a href="#cdk-nextjs.NextjsDistribution">NextjsDistribution</a></code> | *No description.* |
953
947
  | <code><a href="#cdk-nextjs.NextjsGlobalContainers.property.nextjsFileSystem">nextjsFileSystem</a></code> | <code><a href="#cdk-nextjs.NextjsFileSystem">NextjsFileSystem</a></code> | *No description.* |
954
- | <code><a href="#cdk-nextjs.NextjsGlobalContainers.property.nextjsInvalidation">nextjsInvalidation</a></code> | <code><a href="#cdk-nextjs.NextjsInvalidation">NextjsInvalidation</a></code> | *No description.* |
948
+ | <code><a href="#cdk-nextjs.NextjsGlobalContainers.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a></code> | *No description.* |
955
949
  | <code><a href="#cdk-nextjs.NextjsGlobalContainers.property.nextjsStaticAssets">nextjsStaticAssets</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssets">NextjsStaticAssets</a></code> | *No description.* |
956
950
  | <code><a href="#cdk-nextjs.NextjsGlobalContainers.property.nextjsVpc">nextjsVpc</a></code> | <code><a href="#cdk-nextjs.NextjsVpc">NextjsVpc</a></code> | *No description.* |
957
951
 
@@ -1019,13 +1013,13 @@ public readonly nextjsFileSystem: NextjsFileSystem;
1019
1013
 
1020
1014
  ---
1021
1015
 
1022
- ##### `nextjsInvalidation`<sup>Required</sup> <a name="nextjsInvalidation" id="cdk-nextjs.NextjsGlobalContainers.property.nextjsInvalidation"></a>
1016
+ ##### `nextjsPostDeploy`<sup>Required</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsGlobalContainers.property.nextjsPostDeploy"></a>
1023
1017
 
1024
1018
  ```typescript
1025
- public readonly nextjsInvalidation: NextjsInvalidation;
1019
+ public readonly nextjsPostDeploy: NextjsPostDeploy;
1026
1020
  ```
1027
1021
 
1028
- - *Type:* <a href="#cdk-nextjs.NextjsInvalidation">NextjsInvalidation</a>
1022
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a>
1029
1023
 
1030
1024
  ---
1031
1025
 
@@ -1140,8 +1134,7 @@ Any object.
1140
1134
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsDistribution">nextjsDistribution</a></code> | <code><a href="#cdk-nextjs.NextjsDistribution">NextjsDistribution</a></code> | *No description.* |
1141
1135
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsFileSystem">nextjsFileSystem</a></code> | <code><a href="#cdk-nextjs.NextjsFileSystem">NextjsFileSystem</a></code> | *No description.* |
1142
1136
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsFunctions">nextjsFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsFunctions">NextjsFunctions</a></code> | *No description.* |
1143
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsInvalidation">nextjsInvalidation</a></code> | <code><a href="#cdk-nextjs.NextjsInvalidation">NextjsInvalidation</a></code> | *No description.* |
1144
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsRevalidation">nextjsRevalidation</a></code> | <code><a href="#cdk-nextjs.NextjsRevalidation">NextjsRevalidation</a></code> | *No description.* |
1137
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a></code> | *No description.* |
1145
1138
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsStaticAssets">nextjsStaticAssets</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssets">NextjsStaticAssets</a></code> | *No description.* |
1146
1139
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctions.property.nextjsVpc">nextjsVpc</a></code> | <code><a href="#cdk-nextjs.NextjsVpc">NextjsVpc</a></code> | *No description.* |
1147
1140
 
@@ -1209,23 +1202,13 @@ public readonly nextjsFunctions: NextjsFunctions;
1209
1202
 
1210
1203
  ---
1211
1204
 
1212
- ##### `nextjsInvalidation`<sup>Required</sup> <a name="nextjsInvalidation" id="cdk-nextjs.NextjsGlobalFunctions.property.nextjsInvalidation"></a>
1213
-
1214
- ```typescript
1215
- public readonly nextjsInvalidation: NextjsInvalidation;
1216
- ```
1217
-
1218
- - *Type:* <a href="#cdk-nextjs.NextjsInvalidation">NextjsInvalidation</a>
1219
-
1220
- ---
1221
-
1222
- ##### `nextjsRevalidation`<sup>Required</sup> <a name="nextjsRevalidation" id="cdk-nextjs.NextjsGlobalFunctions.property.nextjsRevalidation"></a>
1205
+ ##### `nextjsPostDeploy`<sup>Required</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsGlobalFunctions.property.nextjsPostDeploy"></a>
1223
1206
 
1224
1207
  ```typescript
1225
- public readonly nextjsRevalidation: NextjsRevalidation;
1208
+ public readonly nextjsPostDeploy: NextjsPostDeploy;
1226
1209
  ```
1227
1210
 
1228
- - *Type:* <a href="#cdk-nextjs.NextjsRevalidation">NextjsRevalidation</a>
1211
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a>
1229
1212
 
1230
1213
  ---
1231
1214
 
@@ -1250,39 +1233,46 @@ public readonly nextjsVpc: NextjsVpc;
1250
1233
  ---
1251
1234
 
1252
1235
 
1253
- ### NextjsInvalidation <a name="NextjsInvalidation" id="cdk-nextjs.NextjsInvalidation"></a>
1236
+ ### NextjsPostDeploy <a name="NextjsPostDeploy" id="cdk-nextjs.NextjsPostDeploy"></a>
1237
+
1238
+ Performs post deployment tasks in custom resource.
1254
1239
 
1255
- #### Initializers <a name="Initializers" id="cdk-nextjs.NextjsInvalidation.Initializer"></a>
1240
+ 1. CloudFront Invalidation (defaults to /*)
1241
+ 2. Prunes FileSystem by removing directories that don't match this deployments BUILD_ID
1242
+ 3. Prune S3 by removing objects that don't have next-build-id metadata of
1243
+ current build id AND are older than `msTtl`
1244
+
1245
+ #### Initializers <a name="Initializers" id="cdk-nextjs.NextjsPostDeploy.Initializer"></a>
1256
1246
 
1257
1247
  ```typescript
1258
- import { NextjsInvalidation } from 'cdk-nextjs'
1248
+ import { NextjsPostDeploy } from 'cdk-nextjs'
1259
1249
 
1260
- new NextjsInvalidation(scope: Construct, id: string, props: NextjsInvalidationProps)
1250
+ new NextjsPostDeploy(scope: Construct, id: string, props: NextjsPostDeployProps)
1261
1251
  ```
1262
1252
 
1263
1253
  | **Name** | **Type** | **Description** |
1264
1254
  | --- | --- | --- |
1265
- | <code><a href="#cdk-nextjs.NextjsInvalidation.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
1266
- | <code><a href="#cdk-nextjs.NextjsInvalidation.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
1267
- | <code><a href="#cdk-nextjs.NextjsInvalidation.Initializer.parameter.props">props</a></code> | <code><a href="#cdk-nextjs.NextjsInvalidationProps">NextjsInvalidationProps</a></code> | *No description.* |
1255
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
1256
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
1257
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.Initializer.parameter.props">props</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployProps">NextjsPostDeployProps</a></code> | *No description.* |
1268
1258
 
1269
1259
  ---
1270
1260
 
1271
- ##### `scope`<sup>Required</sup> <a name="scope" id="cdk-nextjs.NextjsInvalidation.Initializer.parameter.scope"></a>
1261
+ ##### `scope`<sup>Required</sup> <a name="scope" id="cdk-nextjs.NextjsPostDeploy.Initializer.parameter.scope"></a>
1272
1262
 
1273
1263
  - *Type:* constructs.Construct
1274
1264
 
1275
1265
  ---
1276
1266
 
1277
- ##### `id`<sup>Required</sup> <a name="id" id="cdk-nextjs.NextjsInvalidation.Initializer.parameter.id"></a>
1267
+ ##### `id`<sup>Required</sup> <a name="id" id="cdk-nextjs.NextjsPostDeploy.Initializer.parameter.id"></a>
1278
1268
 
1279
1269
  - *Type:* string
1280
1270
 
1281
1271
  ---
1282
1272
 
1283
- ##### `props`<sup>Required</sup> <a name="props" id="cdk-nextjs.NextjsInvalidation.Initializer.parameter.props"></a>
1273
+ ##### `props`<sup>Required</sup> <a name="props" id="cdk-nextjs.NextjsPostDeploy.Initializer.parameter.props"></a>
1284
1274
 
1285
- - *Type:* <a href="#cdk-nextjs.NextjsInvalidationProps">NextjsInvalidationProps</a>
1275
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeployProps">NextjsPostDeployProps</a>
1286
1276
 
1287
1277
  ---
1288
1278
 
@@ -1290,11 +1280,11 @@ new NextjsInvalidation(scope: Construct, id: string, props: NextjsInvalidationPr
1290
1280
 
1291
1281
  | **Name** | **Description** |
1292
1282
  | --- | --- |
1293
- | <code><a href="#cdk-nextjs.NextjsInvalidation.toString">toString</a></code> | Returns a string representation of this construct. |
1283
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.toString">toString</a></code> | Returns a string representation of this construct. |
1294
1284
 
1295
1285
  ---
1296
1286
 
1297
- ##### `toString` <a name="toString" id="cdk-nextjs.NextjsInvalidation.toString"></a>
1287
+ ##### `toString` <a name="toString" id="cdk-nextjs.NextjsPostDeploy.toString"></a>
1298
1288
 
1299
1289
  ```typescript
1300
1290
  public toString(): string
@@ -1306,21 +1296,21 @@ Returns a string representation of this construct.
1306
1296
 
1307
1297
  | **Name** | **Description** |
1308
1298
  | --- | --- |
1309
- | <code><a href="#cdk-nextjs.NextjsInvalidation.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
1299
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
1310
1300
 
1311
1301
  ---
1312
1302
 
1313
- ##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk-nextjs.NextjsInvalidation.isConstruct"></a>
1303
+ ##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk-nextjs.NextjsPostDeploy.isConstruct"></a>
1314
1304
 
1315
1305
  ```typescript
1316
- import { NextjsInvalidation } from 'cdk-nextjs'
1306
+ import { NextjsPostDeploy } from 'cdk-nextjs'
1317
1307
 
1318
- NextjsInvalidation.isConstruct(x: any)
1308
+ NextjsPostDeploy.isConstruct(x: any)
1319
1309
  ```
1320
1310
 
1321
1311
  Checks if `x` is a construct.
1322
1312
 
1323
- ###### `x`<sup>Required</sup> <a name="x" id="cdk-nextjs.NextjsInvalidation.isConstruct.parameter.x"></a>
1313
+ ###### `x`<sup>Required</sup> <a name="x" id="cdk-nextjs.NextjsPostDeploy.isConstruct.parameter.x"></a>
1324
1314
 
1325
1315
  - *Type:* any
1326
1316
 
@@ -1332,11 +1322,13 @@ Any object.
1332
1322
 
1333
1323
  | **Name** | **Type** | **Description** |
1334
1324
  | --- | --- | --- |
1335
- | <code><a href="#cdk-nextjs.NextjsInvalidation.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
1325
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
1326
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.property.customResource">customResource</a></code> | <code>aws-cdk-lib.CustomResource</code> | *No description.* |
1327
+ | <code><a href="#cdk-nextjs.NextjsPostDeploy.property.lambdaFunction">lambdaFunction</a></code> | <code>aws-cdk-lib.aws_lambda.Function</code> | *No description.* |
1336
1328
 
1337
1329
  ---
1338
1330
 
1339
- ##### `node`<sup>Required</sup> <a name="node" id="cdk-nextjs.NextjsInvalidation.property.node"></a>
1331
+ ##### `node`<sup>Required</sup> <a name="node" id="cdk-nextjs.NextjsPostDeploy.property.node"></a>
1340
1332
 
1341
1333
  ```typescript
1342
1334
  public readonly node: Node;
@@ -1348,6 +1340,26 @@ The tree node.
1348
1340
 
1349
1341
  ---
1350
1342
 
1343
+ ##### `customResource`<sup>Required</sup> <a name="customResource" id="cdk-nextjs.NextjsPostDeploy.property.customResource"></a>
1344
+
1345
+ ```typescript
1346
+ public readonly customResource: CustomResource;
1347
+ ```
1348
+
1349
+ - *Type:* aws-cdk-lib.CustomResource
1350
+
1351
+ ---
1352
+
1353
+ ##### `lambdaFunction`<sup>Required</sup> <a name="lambdaFunction" id="cdk-nextjs.NextjsPostDeploy.property.lambdaFunction"></a>
1354
+
1355
+ ```typescript
1356
+ public readonly lambdaFunction: Function;
1357
+ ```
1358
+
1359
+ - *Type:* aws-cdk-lib.aws_lambda.Function
1360
+
1361
+ ---
1362
+
1351
1363
 
1352
1364
  ### NextjsRegionalContainers <a name="NextjsRegionalContainers" id="cdk-nextjs.NextjsRegionalContainers"></a>
1353
1365
 
@@ -1438,6 +1450,7 @@ Any object.
1438
1450
  | <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsBuild">nextjsBuild</a></code> | <code><a href="#cdk-nextjs.NextjsBuild">NextjsBuild</a></code> | *No description.* |
1439
1451
  | <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsContainers">nextjsContainers</a></code> | <code><a href="#cdk-nextjs.NextjsContainers">NextjsContainers</a></code> | *No description.* |
1440
1452
  | <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsFileSystem">nextjsFileSystem</a></code> | <code><a href="#cdk-nextjs.NextjsFileSystem">NextjsFileSystem</a></code> | *No description.* |
1453
+ | <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a></code> | *No description.* |
1441
1454
  | <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsVpc">nextjsVpc</a></code> | <code><a href="#cdk-nextjs.NextjsVpc">NextjsVpc</a></code> | *No description.* |
1442
1455
 
1443
1456
  ---
@@ -1494,136 +1507,23 @@ public readonly nextjsFileSystem: NextjsFileSystem;
1494
1507
 
1495
1508
  ---
1496
1509
 
1497
- ##### `nextjsVpc`<sup>Required</sup> <a name="nextjsVpc" id="cdk-nextjs.NextjsRegionalContainers.property.nextjsVpc"></a>
1498
-
1499
- ```typescript
1500
- public readonly nextjsVpc: NextjsVpc;
1501
- ```
1502
-
1503
- - *Type:* <a href="#cdk-nextjs.NextjsVpc">NextjsVpc</a>
1504
-
1505
- ---
1506
-
1507
-
1508
- ### NextjsRevalidation <a name="NextjsRevalidation" id="cdk-nextjs.NextjsRevalidation"></a>
1509
-
1510
- [On-Demand Revalidation](https://nextjs.org/docs/app/building-your-application/caching#on-demand-revalidation) (i.e. `revalidateTag`, `revlidatePath`) doesn't work by default in Lambda environment because it tries to run every request completes when Lambda spins down. Therefore, we use a SQS Queue and Lambda function to run revalidation async.
1511
-
1512
- #### Initializers <a name="Initializers" id="cdk-nextjs.NextjsRevalidation.Initializer"></a>
1513
-
1514
- ```typescript
1515
- import { NextjsRevalidation } from 'cdk-nextjs'
1516
-
1517
- new NextjsRevalidation(scope: Construct, id: string, props: NextjsRevalidationProps)
1518
- ```
1519
-
1520
- | **Name** | **Type** | **Description** |
1521
- | --- | --- | --- |
1522
- | <code><a href="#cdk-nextjs.NextjsRevalidation.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
1523
- | <code><a href="#cdk-nextjs.NextjsRevalidation.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
1524
- | <code><a href="#cdk-nextjs.NextjsRevalidation.Initializer.parameter.props">props</a></code> | <code><a href="#cdk-nextjs.NextjsRevalidationProps">NextjsRevalidationProps</a></code> | *No description.* |
1525
-
1526
- ---
1527
-
1528
- ##### `scope`<sup>Required</sup> <a name="scope" id="cdk-nextjs.NextjsRevalidation.Initializer.parameter.scope"></a>
1529
-
1530
- - *Type:* constructs.Construct
1531
-
1532
- ---
1533
-
1534
- ##### `id`<sup>Required</sup> <a name="id" id="cdk-nextjs.NextjsRevalidation.Initializer.parameter.id"></a>
1535
-
1536
- - *Type:* string
1537
-
1538
- ---
1539
-
1540
- ##### `props`<sup>Required</sup> <a name="props" id="cdk-nextjs.NextjsRevalidation.Initializer.parameter.props"></a>
1541
-
1542
- - *Type:* <a href="#cdk-nextjs.NextjsRevalidationProps">NextjsRevalidationProps</a>
1543
-
1544
- ---
1545
-
1546
- #### Methods <a name="Methods" id="Methods"></a>
1547
-
1548
- | **Name** | **Description** |
1549
- | --- | --- |
1550
- | <code><a href="#cdk-nextjs.NextjsRevalidation.toString">toString</a></code> | Returns a string representation of this construct. |
1551
-
1552
- ---
1553
-
1554
- ##### `toString` <a name="toString" id="cdk-nextjs.NextjsRevalidation.toString"></a>
1555
-
1556
- ```typescript
1557
- public toString(): string
1558
- ```
1559
-
1560
- Returns a string representation of this construct.
1561
-
1562
- #### Static Functions <a name="Static Functions" id="Static Functions"></a>
1563
-
1564
- | **Name** | **Description** |
1565
- | --- | --- |
1566
- | <code><a href="#cdk-nextjs.NextjsRevalidation.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
1567
-
1568
- ---
1569
-
1570
- ##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk-nextjs.NextjsRevalidation.isConstruct"></a>
1571
-
1572
- ```typescript
1573
- import { NextjsRevalidation } from 'cdk-nextjs'
1574
-
1575
- NextjsRevalidation.isConstruct(x: any)
1576
- ```
1577
-
1578
- Checks if `x` is a construct.
1579
-
1580
- ###### `x`<sup>Required</sup> <a name="x" id="cdk-nextjs.NextjsRevalidation.isConstruct.parameter.x"></a>
1581
-
1582
- - *Type:* any
1583
-
1584
- Any object.
1585
-
1586
- ---
1587
-
1588
- #### Properties <a name="Properties" id="Properties"></a>
1589
-
1590
- | **Name** | **Type** | **Description** |
1591
- | --- | --- | --- |
1592
- | <code><a href="#cdk-nextjs.NextjsRevalidation.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
1593
- | <code><a href="#cdk-nextjs.NextjsRevalidation.property.fn">fn</a></code> | <code>aws-cdk-lib.aws_lambda.Function</code> | *No description.* |
1594
- | <code><a href="#cdk-nextjs.NextjsRevalidation.property.queue">queue</a></code> | <code>aws-cdk-lib.aws_sqs.Queue</code> | *No description.* |
1595
-
1596
- ---
1597
-
1598
- ##### `node`<sup>Required</sup> <a name="node" id="cdk-nextjs.NextjsRevalidation.property.node"></a>
1599
-
1600
- ```typescript
1601
- public readonly node: Node;
1602
- ```
1603
-
1604
- - *Type:* constructs.Node
1605
-
1606
- The tree node.
1607
-
1608
- ---
1609
-
1610
- ##### `fn`<sup>Required</sup> <a name="fn" id="cdk-nextjs.NextjsRevalidation.property.fn"></a>
1510
+ ##### `nextjsPostDeploy`<sup>Required</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsRegionalContainers.property.nextjsPostDeploy"></a>
1611
1511
 
1612
1512
  ```typescript
1613
- public readonly fn: Function;
1513
+ public readonly nextjsPostDeploy: NextjsPostDeploy;
1614
1514
  ```
1615
1515
 
1616
- - *Type:* aws-cdk-lib.aws_lambda.Function
1516
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeploy">NextjsPostDeploy</a>
1617
1517
 
1618
1518
  ---
1619
1519
 
1620
- ##### `queue`<sup>Required</sup> <a name="queue" id="cdk-nextjs.NextjsRevalidation.property.queue"></a>
1520
+ ##### `nextjsVpc`<sup>Required</sup> <a name="nextjsVpc" id="cdk-nextjs.NextjsRegionalContainers.property.nextjsVpc"></a>
1621
1521
 
1622
1522
  ```typescript
1623
- public readonly queue: Queue;
1523
+ public readonly nextjsVpc: NextjsVpc;
1624
1524
  ```
1625
1525
 
1626
- - *Type:* aws-cdk-lib.aws_sqs.Queue
1526
+ - *Type:* <a href="#cdk-nextjs.NextjsVpc">NextjsVpc</a>
1627
1527
 
1628
1528
  ---
1629
1529
 
@@ -1920,6 +1820,7 @@ const baseNextjsConstructOverrides: BaseNextjsConstructOverrides = { ... }
1920
1820
  | <code><a href="#cdk-nextjs.BaseNextjsConstructOverrides.property.nextjsAssetsDeploymentProps">nextjsAssetsDeploymentProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps">OptionalNextjsAssetsDeploymentProps</a></code> | *No description.* |
1921
1821
  | <code><a href="#cdk-nextjs.BaseNextjsConstructOverrides.property.nextjsBuildProps">nextjsBuildProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a></code> | *No description.* |
1922
1822
  | <code><a href="#cdk-nextjs.BaseNextjsConstructOverrides.property.nextjsFileSystemProps">nextjsFileSystemProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsFileSystemProps">OptionalNextjsFileSystemProps</a></code> | *No description.* |
1823
+ | <code><a href="#cdk-nextjs.BaseNextjsConstructOverrides.property.nextjsPostDeployProps">nextjsPostDeployProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a></code> | *No description.* |
1923
1824
  | <code><a href="#cdk-nextjs.BaseNextjsConstructOverrides.property.nextjsVpcProps">nextjsVpcProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsVpcProps">OptionalNextjsVpcProps</a></code> | *No description.* |
1924
1825
 
1925
1826
  ---
@@ -1954,6 +1855,16 @@ public readonly nextjsFileSystemProps: OptionalNextjsFileSystemProps;
1954
1855
 
1955
1856
  ---
1956
1857
 
1858
+ ##### `nextjsPostDeployProps`<sup>Optional</sup> <a name="nextjsPostDeployProps" id="cdk-nextjs.BaseNextjsConstructOverrides.property.nextjsPostDeployProps"></a>
1859
+
1860
+ ```typescript
1861
+ public readonly nextjsPostDeployProps: OptionalNextjsPostDeployProps;
1862
+ ```
1863
+
1864
+ - *Type:* <a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a>
1865
+
1866
+ ---
1867
+
1957
1868
  ##### `nextjsVpcProps`<sup>Optional</sup> <a name="nextjsVpcProps" id="cdk-nextjs.BaseNextjsConstructOverrides.property.nextjsVpcProps"></a>
1958
1869
 
1959
1870
  ```typescript
@@ -1983,6 +1894,7 @@ const baseNextjsOverrides: BaseNextjsOverrides = { ... }
1983
1894
  | <code><a href="#cdk-nextjs.BaseNextjsOverrides.property.nextjsAssetsDeployment">nextjsAssetsDeployment</a></code> | <code><a href="#cdk-nextjs.NextjsAssetDeploymentOverrides">NextjsAssetDeploymentOverrides</a></code> | *No description.* |
1984
1895
  | <code><a href="#cdk-nextjs.BaseNextjsOverrides.property.nextjsBuild">nextjsBuild</a></code> | <code><a href="#cdk-nextjs.NextjsBuildOverrides">NextjsBuildOverrides</a></code> | *No description.* |
1985
1896
  | <code><a href="#cdk-nextjs.BaseNextjsOverrides.property.nextjsFileSystem">nextjsFileSystem</a></code> | <code><a href="#cdk-nextjs.NextjsFileSystemOverrides">NextjsFileSystemOverrides</a></code> | *No description.* |
1897
+ | <code><a href="#cdk-nextjs.BaseNextjsOverrides.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | *No description.* |
1986
1898
  | <code><a href="#cdk-nextjs.BaseNextjsOverrides.property.nextjsVpc">nextjsVpc</a></code> | <code><a href="#cdk-nextjs.NextjsVpcOverrides">NextjsVpcOverrides</a></code> | *No description.* |
1987
1899
 
1988
1900
  ---
@@ -2017,6 +1929,16 @@ public readonly nextjsFileSystem: NextjsFileSystemOverrides;
2017
1929
 
2018
1930
  ---
2019
1931
 
1932
+ ##### `nextjsPostDeploy`<sup>Optional</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.BaseNextjsOverrides.property.nextjsPostDeploy"></a>
1933
+
1934
+ ```typescript
1935
+ public readonly nextjsPostDeploy: NextjsPostDeployOverrides;
1936
+ ```
1937
+
1938
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a>
1939
+
1940
+ ---
1941
+
2020
1942
  ##### `nextjsVpc`<sup>Optional</sup> <a name="nextjsVpc" id="cdk-nextjs.BaseNextjsOverrides.property.nextjsVpc"></a>
2021
1943
 
2022
1944
  ```typescript
@@ -2043,10 +1965,9 @@ const builderImageProps: BuilderImageProps = { ... }
2043
1965
  | --- | --- | --- |
2044
1966
  | <code><a href="#cdk-nextjs.BuilderImageProps.property.buildArgs">buildArgs</a></code> | <code>{[ key: string ]: string}</code> | Build Args to be passed to `docker build` command. |
2045
1967
  | <code><a href="#cdk-nextjs.BuilderImageProps.property.command">command</a></code> | <code>string</code> | `docker build ...` command to run in {@link NextBaseProps.buildContext }. Default interpolates other props. If you override, other props will have no effect on command. |
2046
- | <code><a href="#cdk-nextjs.BuilderImageProps.property.customDockerfilePath">customDockerfilePath</a></code> | <code>string</code> | Path to your custom builder.Dockerfile which will be copied into {@link NextBaseProps.buildContext }. It is recommended to override this prop to optimize build caching for your setup. |
2047
1968
  | <code><a href="#cdk-nextjs.BuilderImageProps.property.envVarNames">envVarNames</a></code> | <code>string[]</code> | Environment variables names to pass from host to container during build process. |
2048
1969
  | <code><a href="#cdk-nextjs.BuilderImageProps.property.exclude">exclude</a></code> | <code>string[]</code> | Lines in .dockerignore file which will be created in your {@link NextBaseProps.buildContext }. |
2049
- | <code><a href="#cdk-nextjs.BuilderImageProps.property.file">file</a></code> | <code>string</code> | Name of Dockerfile. |
1970
+ | <code><a href="#cdk-nextjs.BuilderImageProps.property.file">file</a></code> | <code>string</code> | Name of Dockerfile in builder build context. |
2050
1971
  | <code><a href="#cdk-nextjs.BuilderImageProps.property.platform">platform</a></code> | <code>aws-cdk-lib.aws_ecr_assets.Platform</code> | *No description.* |
2051
1972
  | <code><a href="#cdk-nextjs.BuilderImageProps.property.skipBuild">skipBuild</a></code> | <code>boolean</code> | Skip building the builder image. |
2052
1973
 
@@ -2076,18 +1997,6 @@ public readonly command: string;
2076
1997
 
2077
1998
  ---
2078
1999
 
2079
- ##### `customDockerfilePath`<sup>Optional</sup> <a name="customDockerfilePath" id="cdk-nextjs.BuilderImageProps.property.customDockerfilePath"></a>
2080
-
2081
- ```typescript
2082
- public readonly customDockerfilePath: string;
2083
- ```
2084
-
2085
- - *Type:* string
2086
-
2087
- Path to your custom builder.Dockerfile which will be copied into {@link NextBaseProps.buildContext }. It is recommended to override this prop to optimize build caching for your setup.
2088
-
2089
- ---
2090
-
2091
2000
  ##### `envVarNames`<sup>Optional</sup> <a name="envVarNames" id="cdk-nextjs.BuilderImageProps.property.envVarNames"></a>
2092
2001
 
2093
2002
  ```typescript
@@ -2101,7 +2010,7 @@ Environment variables names to pass from host to container during build process.
2101
2010
  Note, a shell script, cdk-nextjs-load-env-vars.sh is created within the
2102
2011
  {@link NextBaseProps.buildContext } directory, which will contain all the
2103
2012
  environment variables defined in this prop. If you've created your own
2104
- custom Dockerfile (passed in via {@link BuilderImageProps.customDockerfilePath})
2013
+ custom Dockerfile (passed in via {@link BuilderImageProps.customDockerfilePath })
2105
2014
  then you need to make sure you're copying it into the image.
2106
2015
 
2107
2016
  ---
@@ -2135,7 +2044,10 @@ public readonly file: string;
2135
2044
  - *Type:* string
2136
2045
  - *Default:* "builder.Dockerfile"
2137
2046
 
2138
- Name of Dockerfile.
2047
+ Name of Dockerfile in builder build context.
2048
+
2049
+ If specified, you are responsible
2050
+ for ensuring it exists in build context before construct is instantiated.
2139
2051
 
2140
2052
  ---
2141
2053
 
@@ -2176,10 +2088,23 @@ const nextjsAssetDeploymentOverrides: NextjsAssetDeploymentOverrides = { ... }
2176
2088
 
2177
2089
  | **Name** | **Type** | **Description** |
2178
2090
  | --- | --- | --- |
2091
+ | <code><a href="#cdk-nextjs.NextjsAssetDeploymentOverrides.property.customResourceProps">customResourceProps</a></code> | <code><a href="#cdk-nextjs.OptionalCustomResourceProps">OptionalCustomResourceProps</a></code> | Props that define the custom resource. |
2179
2092
  | <code><a href="#cdk-nextjs.NextjsAssetDeploymentOverrides.property.dockerImageFunctionProps">dockerImageFunctionProps</a></code> | <code><a href="#cdk-nextjs.OptionalDockerImageFunctionProps">OptionalDockerImageFunctionProps</a></code> | *No description.* |
2180
2093
 
2181
2094
  ---
2182
2095
 
2096
+ ##### `customResourceProps`<sup>Optional</sup> <a name="customResourceProps" id="cdk-nextjs.NextjsAssetDeploymentOverrides.property.customResourceProps"></a>
2097
+
2098
+ ```typescript
2099
+ public readonly customResourceProps: OptionalCustomResourceProps;
2100
+ ```
2101
+
2102
+ - *Type:* <a href="#cdk-nextjs.OptionalCustomResourceProps">OptionalCustomResourceProps</a>
2103
+
2104
+ Props that define the custom resource.
2105
+
2106
+ ---
2107
+
2183
2108
  ##### `dockerImageFunctionProps`<sup>Optional</sup> <a name="dockerImageFunctionProps" id="cdk-nextjs.NextjsAssetDeploymentOverrides.property.dockerImageFunctionProps"></a>
2184
2109
 
2185
2110
  ```typescript
@@ -2205,15 +2130,15 @@ const nextjsAssetsDeploymentProps: NextjsAssetsDeploymentProps = { ... }
2205
2130
  | **Name** | **Type** | **Description** |
2206
2131
  | --- | --- | --- |
2207
2132
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
2133
+ | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.buildId">buildId</a></code> | <code>string</code> | *No description.* |
2208
2134
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.buildImageDigest">buildImageDigest</a></code> | <code>string</code> | *No description.* |
2209
- | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.containerMountPathForEfs">containerMountPathForEfs</a></code> | <code>string</code> | *No description.* |
2210
2135
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.dockerImageCode">dockerImageCode</a></code> | <code>aws-cdk-lib.aws_lambda.DockerImageCode</code> | *No description.* |
2211
2136
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.nextjsType">nextjsType</a></code> | <code><a href="#cdk-nextjs.NextjsType">NextjsType</a></code> | *No description.* |
2212
2137
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
2213
2138
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.basePath">basePath</a></code> | <code>string</code> | Prefix to the URI path the app will be served at. |
2214
- | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.debug">debug</a></code> | <code>boolean</code> | *No description.* |
2139
+ | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.debug">debug</a></code> | <code>boolean</code> | If true, logs details in custom resource lambda. |
2215
2140
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsAssetDeploymentOverrides">NextjsAssetDeploymentOverrides</a></code> | *No description.* |
2216
- | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
2141
+ | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | *No description.* |
2217
2142
  | <code><a href="#cdk-nextjs.NextjsAssetsDeploymentProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.Bucket</code> | Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`. |
2218
2143
 
2219
2144
  ---
@@ -2228,27 +2153,25 @@ public readonly accessPoint: AccessPoint;
2228
2153
 
2229
2154
  ---
2230
2155
 
2231
- ##### `buildImageDigest`<sup>Required</sup> <a name="buildImageDigest" id="cdk-nextjs.NextjsAssetsDeploymentProps.property.buildImageDigest"></a>
2156
+ ##### `buildId`<sup>Required</sup> <a name="buildId" id="cdk-nextjs.NextjsAssetsDeploymentProps.property.buildId"></a>
2232
2157
 
2233
2158
  ```typescript
2234
- public readonly buildImageDigest: string;
2159
+ public readonly buildId: string;
2235
2160
  ```
2236
2161
 
2237
2162
  - *Type:* string
2238
2163
 
2239
- > [{@link NextjsBuild.buildImageDigest }]({@link NextjsBuild.buildImageDigest })
2240
-
2241
2164
  ---
2242
2165
 
2243
- ##### `containerMountPathForEfs`<sup>Required</sup> <a name="containerMountPathForEfs" id="cdk-nextjs.NextjsAssetsDeploymentProps.property.containerMountPathForEfs"></a>
2166
+ ##### `buildImageDigest`<sup>Required</sup> <a name="buildImageDigest" id="cdk-nextjs.NextjsAssetsDeploymentProps.property.buildImageDigest"></a>
2244
2167
 
2245
2168
  ```typescript
2246
- public readonly containerMountPathForEfs: string;
2169
+ public readonly buildImageDigest: string;
2247
2170
  ```
2248
2171
 
2249
2172
  - *Type:* string
2250
2173
 
2251
- > [{@link NextjsBuild.containerMountPathForEfs }]({@link NextjsBuild.containerMountPathForEfs })
2174
+ > [{@link NextjsBuild.buildImageDigest }]({@link NextjsBuild.buildImageDigest })
2252
2175
 
2253
2176
  ---
2254
2177
 
@@ -2310,6 +2233,8 @@ public readonly debug: boolean;
2310
2233
  - *Type:* boolean
2311
2234
  - *Default:* true
2312
2235
 
2236
+ If true, logs details in custom resource lambda.
2237
+
2313
2238
  ---
2314
2239
 
2315
2240
  ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsAssetsDeploymentProps.property.overrides"></a>
@@ -2322,15 +2247,15 @@ public readonly overrides: NextjsAssetDeploymentOverrides;
2322
2247
 
2323
2248
  ---
2324
2249
 
2325
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsAssetsDeploymentProps.property.relativePathToWorkspace"></a>
2250
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.NextjsAssetsDeploymentProps.property.relativePathToPackage"></a>
2326
2251
 
2327
2252
  ```typescript
2328
- public readonly relativePathToWorkspace: string;
2253
+ public readonly relativePathToPackage: string;
2329
2254
  ```
2330
2255
 
2331
2256
  - *Type:* string
2332
2257
 
2333
- > [{@link NextjsBaseProps.relativePathToWorkspace }]({@link NextjsBaseProps.relativePathToWorkspace })
2258
+ > [{@link NextjsBaseProps.relativePathToPackage }]({@link NextjsBaseProps.relativePathToPackage })
2334
2259
 
2335
2260
  ---
2336
2261
 
@@ -2360,10 +2285,11 @@ const nextjsBaseProps: NextjsBaseProps = { ... }
2360
2285
 
2361
2286
  | **Name** | **Type** | **Description** |
2362
2287
  | --- | --- | --- |
2363
- | <code><a href="#cdk-nextjs.NextjsBaseProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}. |
2288
+ | <code><a href="#cdk-nextjs.NextjsBaseProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}. |
2364
2289
  | <code><a href="#cdk-nextjs.NextjsBaseProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | Path to API Route Handler that returns HTTP 200 to ensure compute health. |
2365
2290
  | <code><a href="#cdk-nextjs.NextjsBaseProps.property.buildCommand">buildCommand</a></code> | <code>string</code> | Command to generate optimized version of your Next.js app in container; |
2366
- | <code><a href="#cdk-nextjs.NextjsBaseProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | Use this if building in monorepo. |
2291
+ | <code><a href="#cdk-nextjs.NextjsBaseProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | Use this if building in monorepo. |
2292
+ | <code><a href="#cdk-nextjs.NextjsBaseProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
2367
2293
 
2368
2294
  ---
2369
2295
 
@@ -2375,14 +2301,20 @@ public readonly buildContext: string;
2375
2301
 
2376
2302
  - *Type:* string
2377
2303
 
2378
- [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}.
2304
+ [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}.
2305
+
2306
+ Note, by default cdk-nextjs' `builder.Dockerfile` is used to build your
2307
+ Next.js app. You can customize this by specifying `overrides.{nextjs...}.nextjsBuildProps.builderImageProps.file`.
2308
+ If you override the default, then you are responsible for ensuring the
2309
+ Dockerfile is in the build context directory before cdk-nextjs construct
2310
+ is instantiated.
2379
2311
 
2380
2312
  ---
2381
2313
 
2382
2314
  *Example*
2383
2315
 
2384
2316
  ```typescript
2385
- fileURLToPath(new URL("../..", import.meta.url)) (monorepo)
2317
+ join(import.meta.dirname, "..") (monorepo)
2386
2318
  ```
2387
2319
 
2388
2320
 
@@ -2423,10 +2355,10 @@ Command to generate optimized version of your Next.js app in container;
2423
2355
 
2424
2356
  ---
2425
2357
 
2426
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsBaseProps.property.relativePathToWorkspace"></a>
2358
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.NextjsBaseProps.property.relativePathToPackage"></a>
2427
2359
 
2428
2360
  ```typescript
2429
- public readonly relativePathToWorkspace: string;
2361
+ public readonly relativePathToPackage: string;
2430
2362
  ```
2431
2363
 
2432
2364
  - *Type:* string
@@ -2434,7 +2366,7 @@ public readonly relativePathToWorkspace: string;
2434
2366
  Use this if building in monorepo.
2435
2367
 
2436
2368
  This is the relative path from
2437
- {@link NextjsBaseProps.buildContext} or root workspace to nested workspace
2369
+ {@link NextjsBaseProps.buildContext} or root workspace to nested package
2438
2370
  containing Next.js app. See example below:
2439
2371
 
2440
2372
  Let's say you have a monorepo with the following folder structure:
@@ -2445,15 +2377,14 @@ Let's say you have a monorepo with the following folder structure:
2445
2377
  - package.json (root)
2446
2378
 
2447
2379
  And your Next.js app directory is the ui folder. Then you would set {@link NextjsBaseProps.buildContext}
2448
- to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToWorkspace}
2380
+ to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToPackage}
2449
2381
  to `"./packages/ui"`.
2450
2382
 
2451
2383
  Note, setting {@link NextjsBaseProps.buildContext} to the root of your
2452
2384
  monorepo will invalidate container runtime (i.e. docker) build cache when any file is
2453
2385
  changed in your monorepo. This is slows down deployments. Checkout how you
2454
2386
  can use [turbo](https://turbo.build/) in [Deploying with Docker Guide](https://turbo.build/repo/docs/handbook/deploying-with-docker)
2455
- to achieve better build caching. It's as easy as running
2456
- `turbo prune my-app --docker` - no config file required.
2387
+ in the cdk-nextjs/examples/turbo.
2457
2388
 
2458
2389
  ---
2459
2390
 
@@ -2464,6 +2395,18 @@ to achieve better build caching. It's as easy as running
2464
2395
  ```
2465
2396
 
2466
2397
 
2398
+ ##### ~~`relativePathToWorkspace`~~<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsBaseProps.property.relativePathToWorkspace"></a>
2399
+
2400
+ - *Deprecated:* use relativePathToPackage
2401
+
2402
+ ```typescript
2403
+ public readonly relativePathToWorkspace: string;
2404
+ ```
2405
+
2406
+ - *Type:* string
2407
+
2408
+ ---
2409
+
2467
2410
  ### NextjsBuildOverrides <a name="NextjsBuildOverrides" id="cdk-nextjs.NextjsBuildOverrides"></a>
2468
2411
 
2469
2412
  #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsBuildOverrides.Initializer"></a>
@@ -2478,12 +2421,54 @@ const nextjsBuildOverrides: NextjsBuildOverrides = { ... }
2478
2421
 
2479
2422
  | **Name** | **Type** | **Description** |
2480
2423
  | --- | --- | --- |
2424
+ | <code><a href="#cdk-nextjs.NextjsBuildOverrides.property.assetsDeploymentImageBuildContext">assetsDeploymentImageBuildContext</a></code> | <code>string</code> | Default folder for build context is the "lib/nextjs-build" folder in the installed cdk-nextjs library which has the "assets-deployment.Dockerfile". Note, if you specify this then you're responsible for ensuring the dockerfile is present in the build context directory and any referenced files are present as well. You can specify dockerfile name with adjacent `nextjsAssetDeploymentAssetImageCodeProps.file` property. |
2425
+ | <code><a href="#cdk-nextjs.NextjsBuildOverrides.property.containersImageBuildContext">containersImageBuildContext</a></code> | <code>string</code> | Default folder for build context is the "assets/lambdas/assets-deployment/assets-deployment.lambda" folder in the installed cdk-nextjs library which has the "{...}-containers.Dockerfile". Note, if you specify this then you're responsible for ensuring the dockerfile is present in the build context directory and any referenced files are present as well. You can specify dockerfile name with adjacent `nextjsContainersDockerImageAssetProps.file` property. |
2426
+ | <code><a href="#cdk-nextjs.NextjsBuildOverrides.property.functionsImageBuildContext">functionsImageBuildContext</a></code> | <code>string</code> | Default folder for build context is the "lib/nextjs-build" folder in the installed cdk-nextjs library which has the "global-functions.Dockerfile". Note, if you specify this then you're responsible for ensuring the dockerfile is present in the build context directory and any referenced files are present as well. You can specify dockerfile name with adjacent `nextjsFunctionsAssetImageCodeProps.file` property. |
2481
2427
  | <code><a href="#cdk-nextjs.NextjsBuildOverrides.property.nextjsAssetDeploymentAssetImageCodeProps">nextjsAssetDeploymentAssetImageCodeProps</a></code> | <code>aws-cdk-lib.aws_lambda.AssetImageCodeProps</code> | *No description.* |
2482
2428
  | <code><a href="#cdk-nextjs.NextjsBuildOverrides.property.nextjsContainersDockerImageAssetProps">nextjsContainersDockerImageAssetProps</a></code> | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps">OptionalDockerImageAssetProps</a></code> | *No description.* |
2483
2429
  | <code><a href="#cdk-nextjs.NextjsBuildOverrides.property.nextjsFunctionsAssetImageCodeProps">nextjsFunctionsAssetImageCodeProps</a></code> | <code>aws-cdk-lib.aws_lambda.AssetImageCodeProps</code> | *No description.* |
2484
2430
 
2485
2431
  ---
2486
2432
 
2433
+ ##### `assetsDeploymentImageBuildContext`<sup>Optional</sup> <a name="assetsDeploymentImageBuildContext" id="cdk-nextjs.NextjsBuildOverrides.property.assetsDeploymentImageBuildContext"></a>
2434
+
2435
+ ```typescript
2436
+ public readonly assetsDeploymentImageBuildContext: string;
2437
+ ```
2438
+
2439
+ - *Type:* string
2440
+ - *Default:* "cdk-nextjs/lib/nextjs-build"
2441
+
2442
+ Default folder for build context is the "lib/nextjs-build" folder in the installed cdk-nextjs library which has the "assets-deployment.Dockerfile". Note, if you specify this then you're responsible for ensuring the dockerfile is present in the build context directory and any referenced files are present as well. You can specify dockerfile name with adjacent `nextjsAssetDeploymentAssetImageCodeProps.file` property.
2443
+
2444
+ ---
2445
+
2446
+ ##### `containersImageBuildContext`<sup>Optional</sup> <a name="containersImageBuildContext" id="cdk-nextjs.NextjsBuildOverrides.property.containersImageBuildContext"></a>
2447
+
2448
+ ```typescript
2449
+ public readonly containersImageBuildContext: string;
2450
+ ```
2451
+
2452
+ - *Type:* string
2453
+ - *Default:* "cdk-nextjs/lib/nextjs-build"
2454
+
2455
+ Default folder for build context is the "assets/lambdas/assets-deployment/assets-deployment.lambda" folder in the installed cdk-nextjs library which has the "{...}-containers.Dockerfile". Note, if you specify this then you're responsible for ensuring the dockerfile is present in the build context directory and any referenced files are present as well. You can specify dockerfile name with adjacent `nextjsContainersDockerImageAssetProps.file` property.
2456
+
2457
+ ---
2458
+
2459
+ ##### `functionsImageBuildContext`<sup>Optional</sup> <a name="functionsImageBuildContext" id="cdk-nextjs.NextjsBuildOverrides.property.functionsImageBuildContext"></a>
2460
+
2461
+ ```typescript
2462
+ public readonly functionsImageBuildContext: string;
2463
+ ```
2464
+
2465
+ - *Type:* string
2466
+ - *Default:* "cdk-nextjs/lib/nextjs-build"
2467
+
2468
+ Default folder for build context is the "lib/nextjs-build" folder in the installed cdk-nextjs library which has the "global-functions.Dockerfile". Note, if you specify this then you're responsible for ensuring the dockerfile is present in the build context directory and any referenced files are present as well. You can specify dockerfile name with adjacent `nextjsFunctionsAssetImageCodeProps.file` property.
2469
+
2470
+ ---
2471
+
2487
2472
  ##### `nextjsAssetDeploymentAssetImageCodeProps`<sup>Optional</sup> <a name="nextjsAssetDeploymentAssetImageCodeProps" id="cdk-nextjs.NextjsBuildOverrides.property.nextjsAssetDeploymentAssetImageCodeProps"></a>
2488
2473
 
2489
2474
  ```typescript
@@ -2533,7 +2518,7 @@ const nextjsBuildProps: NextjsBuildProps = { ... }
2533
2518
  | <code><a href="#cdk-nextjs.NextjsBuildProps.property.buildCommand">buildCommand</a></code> | <code>string</code> | *No description.* |
2534
2519
  | <code><a href="#cdk-nextjs.NextjsBuildProps.property.builderImageProps">builderImageProps</a></code> | <code><a href="#cdk-nextjs.BuilderImageProps">BuilderImageProps</a></code> | *No description.* |
2535
2520
  | <code><a href="#cdk-nextjs.NextjsBuildProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsBuildOverrides">NextjsBuildOverrides</a></code> | *No description.* |
2536
- | <code><a href="#cdk-nextjs.NextjsBuildProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
2521
+ | <code><a href="#cdk-nextjs.NextjsBuildProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | *No description.* |
2537
2522
 
2538
2523
  ---
2539
2524
 
@@ -2591,15 +2576,15 @@ public readonly overrides: NextjsBuildOverrides;
2591
2576
 
2592
2577
  ---
2593
2578
 
2594
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsBuildProps.property.relativePathToWorkspace"></a>
2579
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.NextjsBuildProps.property.relativePathToPackage"></a>
2595
2580
 
2596
2581
  ```typescript
2597
- public readonly relativePathToWorkspace: string;
2582
+ public readonly relativePathToPackage: string;
2598
2583
  ```
2599
2584
 
2600
2585
  - *Type:* string
2601
2586
 
2602
- > [{@link NextjsBaseProps.relativePathToWorkspace }]({@link NextjsBaseProps.relativePathToWorkspace })
2587
+ > [{@link NextjsBaseProps.relativePathToPackage }]({@link NextjsBaseProps.relativePathToPackage })
2603
2588
 
2604
2589
  ---
2605
2590
 
@@ -2618,7 +2603,6 @@ const nextjsComputeBaseProps: NextjsComputeBaseProps = { ... }
2618
2603
  | **Name** | **Type** | **Description** |
2619
2604
  | --- | --- | --- |
2620
2605
  | <code><a href="#cdk-nextjs.NextjsComputeBaseProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
2621
- | <code><a href="#cdk-nextjs.NextjsComputeBaseProps.property.containerMountPathForEfs">containerMountPathForEfs</a></code> | <code>string</code> | *No description.* |
2622
2606
  | <code><a href="#cdk-nextjs.NextjsComputeBaseProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | *No description.* |
2623
2607
  | <code><a href="#cdk-nextjs.NextjsComputeBaseProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
2624
2608
 
@@ -2634,16 +2618,6 @@ public readonly accessPoint: AccessPoint;
2634
2618
 
2635
2619
  ---
2636
2620
 
2637
- ##### `containerMountPathForEfs`<sup>Required</sup> <a name="containerMountPathForEfs" id="cdk-nextjs.NextjsComputeBaseProps.property.containerMountPathForEfs"></a>
2638
-
2639
- ```typescript
2640
- public readonly containerMountPathForEfs: string;
2641
- ```
2642
-
2643
- - *Type:* string
2644
-
2645
- ---
2646
-
2647
2621
  ##### `healthCheckPath`<sup>Required</sup> <a name="healthCheckPath" id="cdk-nextjs.NextjsComputeBaseProps.property.healthCheckPath"></a>
2648
2622
 
2649
2623
  ```typescript
@@ -2729,9 +2703,9 @@ const nextjsContainersProps: NextjsContainersProps = { ... }
2729
2703
  | **Name** | **Type** | **Description** |
2730
2704
  | --- | --- | --- |
2731
2705
  | <code><a href="#cdk-nextjs.NextjsContainersProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
2732
- | <code><a href="#cdk-nextjs.NextjsContainersProps.property.containerMountPathForEfs">containerMountPathForEfs</a></code> | <code>string</code> | *No description.* |
2733
2706
  | <code><a href="#cdk-nextjs.NextjsContainersProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | *No description.* |
2734
2707
  | <code><a href="#cdk-nextjs.NextjsContainersProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
2708
+ | <code><a href="#cdk-nextjs.NextjsContainersProps.property.buildId">buildId</a></code> | <code>string</code> | *No description.* |
2735
2709
  | <code><a href="#cdk-nextjs.NextjsContainersProps.property.dockerImageAsset">dockerImageAsset</a></code> | <code>aws-cdk-lib.aws_ecr_assets.DockerImageAsset</code> | *No description.* |
2736
2710
  | <code><a href="#cdk-nextjs.NextjsContainersProps.property.fileSystem">fileSystem</a></code> | <code>aws-cdk-lib.aws_efs.FileSystem</code> | *No description.* |
2737
2711
  | <code><a href="#cdk-nextjs.NextjsContainersProps.property.nextjsType">nextjsType</a></code> | <code><a href="#cdk-nextjs.NextjsType">NextjsType</a></code> | *No description.* |
@@ -2750,33 +2724,33 @@ public readonly accessPoint: AccessPoint;
2750
2724
 
2751
2725
  ---
2752
2726
 
2753
- ##### `containerMountPathForEfs`<sup>Required</sup> <a name="containerMountPathForEfs" id="cdk-nextjs.NextjsContainersProps.property.containerMountPathForEfs"></a>
2727
+ ##### `healthCheckPath`<sup>Required</sup> <a name="healthCheckPath" id="cdk-nextjs.NextjsContainersProps.property.healthCheckPath"></a>
2754
2728
 
2755
2729
  ```typescript
2756
- public readonly containerMountPathForEfs: string;
2730
+ public readonly healthCheckPath: string;
2757
2731
  ```
2758
2732
 
2759
2733
  - *Type:* string
2760
2734
 
2761
2735
  ---
2762
2736
 
2763
- ##### `healthCheckPath`<sup>Required</sup> <a name="healthCheckPath" id="cdk-nextjs.NextjsContainersProps.property.healthCheckPath"></a>
2737
+ ##### `vpc`<sup>Required</sup> <a name="vpc" id="cdk-nextjs.NextjsContainersProps.property.vpc"></a>
2764
2738
 
2765
2739
  ```typescript
2766
- public readonly healthCheckPath: string;
2740
+ public readonly vpc: IVpc;
2767
2741
  ```
2768
2742
 
2769
- - *Type:* string
2743
+ - *Type:* aws-cdk-lib.aws_ec2.IVpc
2770
2744
 
2771
2745
  ---
2772
2746
 
2773
- ##### `vpc`<sup>Required</sup> <a name="vpc" id="cdk-nextjs.NextjsContainersProps.property.vpc"></a>
2747
+ ##### `buildId`<sup>Required</sup> <a name="buildId" id="cdk-nextjs.NextjsContainersProps.property.buildId"></a>
2774
2748
 
2775
2749
  ```typescript
2776
- public readonly vpc: IVpc;
2750
+ public readonly buildId: string;
2777
2751
  ```
2778
2752
 
2779
- - *Type:* aws-cdk-lib.aws_ec2.IVpc
2753
+ - *Type:* string
2780
2754
 
2781
2755
  ---
2782
2756
 
@@ -3241,9 +3215,9 @@ const nextjsFunctionsProps: NextjsFunctionsProps = { ... }
3241
3215
  | **Name** | **Type** | **Description** |
3242
3216
  | --- | --- | --- |
3243
3217
  | <code><a href="#cdk-nextjs.NextjsFunctionsProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
3244
- | <code><a href="#cdk-nextjs.NextjsFunctionsProps.property.containerMountPathForEfs">containerMountPathForEfs</a></code> | <code>string</code> | *No description.* |
3245
3218
  | <code><a href="#cdk-nextjs.NextjsFunctionsProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | *No description.* |
3246
3219
  | <code><a href="#cdk-nextjs.NextjsFunctionsProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
3220
+ | <code><a href="#cdk-nextjs.NextjsFunctionsProps.property.buildId">buildId</a></code> | <code>string</code> | *No description.* |
3247
3221
  | <code><a href="#cdk-nextjs.NextjsFunctionsProps.property.dockerImageCode">dockerImageCode</a></code> | <code>aws-cdk-lib.aws_lambda.DockerImageCode</code> | *No description.* |
3248
3222
  | <code><a href="#cdk-nextjs.NextjsFunctionsProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsOverrides">NextjsFunctionsOverrides</a></code> | *No description.* |
3249
3223
 
@@ -3259,33 +3233,33 @@ public readonly accessPoint: AccessPoint;
3259
3233
 
3260
3234
  ---
3261
3235
 
3262
- ##### `containerMountPathForEfs`<sup>Required</sup> <a name="containerMountPathForEfs" id="cdk-nextjs.NextjsFunctionsProps.property.containerMountPathForEfs"></a>
3236
+ ##### `healthCheckPath`<sup>Required</sup> <a name="healthCheckPath" id="cdk-nextjs.NextjsFunctionsProps.property.healthCheckPath"></a>
3263
3237
 
3264
3238
  ```typescript
3265
- public readonly containerMountPathForEfs: string;
3239
+ public readonly healthCheckPath: string;
3266
3240
  ```
3267
3241
 
3268
3242
  - *Type:* string
3269
3243
 
3270
3244
  ---
3271
3245
 
3272
- ##### `healthCheckPath`<sup>Required</sup> <a name="healthCheckPath" id="cdk-nextjs.NextjsFunctionsProps.property.healthCheckPath"></a>
3246
+ ##### `vpc`<sup>Required</sup> <a name="vpc" id="cdk-nextjs.NextjsFunctionsProps.property.vpc"></a>
3273
3247
 
3274
3248
  ```typescript
3275
- public readonly healthCheckPath: string;
3249
+ public readonly vpc: IVpc;
3276
3250
  ```
3277
3251
 
3278
- - *Type:* string
3252
+ - *Type:* aws-cdk-lib.aws_ec2.IVpc
3279
3253
 
3280
3254
  ---
3281
3255
 
3282
- ##### `vpc`<sup>Required</sup> <a name="vpc" id="cdk-nextjs.NextjsFunctionsProps.property.vpc"></a>
3256
+ ##### `buildId`<sup>Required</sup> <a name="buildId" id="cdk-nextjs.NextjsFunctionsProps.property.buildId"></a>
3283
3257
 
3284
3258
  ```typescript
3285
- public readonly vpc: IVpc;
3259
+ public readonly buildId: string;
3286
3260
  ```
3287
3261
 
3288
- - *Type:* aws-cdk-lib.aws_ec2.IVpc
3262
+ - *Type:* string
3289
3263
 
3290
3264
  ---
3291
3265
 
@@ -3326,11 +3300,10 @@ const nextjsGlobalContainersConstructOverrides: NextjsGlobalContainersConstructO
3326
3300
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsAssetsDeploymentProps">nextjsAssetsDeploymentProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps">OptionalNextjsAssetsDeploymentProps</a></code> | *No description.* |
3327
3301
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsBuildProps">nextjsBuildProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a></code> | *No description.* |
3328
3302
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsFileSystemProps">nextjsFileSystemProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsFileSystemProps">OptionalNextjsFileSystemProps</a></code> | *No description.* |
3303
+ | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsPostDeployProps">nextjsPostDeployProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a></code> | *No description.* |
3329
3304
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsVpcProps">nextjsVpcProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsVpcProps">OptionalNextjsVpcProps</a></code> | *No description.* |
3330
3305
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsContainersProps">nextjsContainersProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps">OptionalNextjsContainersProps</a></code> | *No description.* |
3331
3306
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsDistributionProps">nextjsDistributionProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps">OptionalNextjsDistributionProps</a></code> | *No description.* |
3332
- | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsInvalidationProps">nextjsInvalidationProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsInvalidationProps">OptionalNextjsInvalidationProps</a></code> | *No description.* |
3333
- | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsRevalidationProps">nextjsRevalidationProps</a></code> | <code><a href="#cdk-nextjs.NextjsRevalidationProps">NextjsRevalidationProps</a></code> | *No description.* |
3334
3307
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsStaticAssetsProps">nextjsStaticAssetsProps</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsProps">NextjsStaticAssetsProps</a></code> | *No description.* |
3335
3308
 
3336
3309
  ---
@@ -3365,6 +3338,16 @@ public readonly nextjsFileSystemProps: OptionalNextjsFileSystemProps;
3365
3338
 
3366
3339
  ---
3367
3340
 
3341
+ ##### `nextjsPostDeployProps`<sup>Optional</sup> <a name="nextjsPostDeployProps" id="cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsPostDeployProps"></a>
3342
+
3343
+ ```typescript
3344
+ public readonly nextjsPostDeployProps: OptionalNextjsPostDeployProps;
3345
+ ```
3346
+
3347
+ - *Type:* <a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a>
3348
+
3349
+ ---
3350
+
3368
3351
  ##### `nextjsVpcProps`<sup>Optional</sup> <a name="nextjsVpcProps" id="cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsVpcProps"></a>
3369
3352
 
3370
3353
  ```typescript
@@ -3395,26 +3378,6 @@ public readonly nextjsDistributionProps: OptionalNextjsDistributionProps;
3395
3378
 
3396
3379
  ---
3397
3380
 
3398
- ##### `nextjsInvalidationProps`<sup>Optional</sup> <a name="nextjsInvalidationProps" id="cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsInvalidationProps"></a>
3399
-
3400
- ```typescript
3401
- public readonly nextjsInvalidationProps: OptionalNextjsInvalidationProps;
3402
- ```
3403
-
3404
- - *Type:* <a href="#cdk-nextjs.OptionalNextjsInvalidationProps">OptionalNextjsInvalidationProps</a>
3405
-
3406
- ---
3407
-
3408
- ##### `nextjsRevalidationProps`<sup>Optional</sup> <a name="nextjsRevalidationProps" id="cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsRevalidationProps"></a>
3409
-
3410
- ```typescript
3411
- public readonly nextjsRevalidationProps: NextjsRevalidationProps;
3412
- ```
3413
-
3414
- - *Type:* <a href="#cdk-nextjs.NextjsRevalidationProps">NextjsRevalidationProps</a>
3415
-
3416
- ---
3417
-
3418
3381
  ##### `nextjsStaticAssetsProps`<sup>Optional</sup> <a name="nextjsStaticAssetsProps" id="cdk-nextjs.NextjsGlobalContainersConstructOverrides.property.nextjsStaticAssetsProps"></a>
3419
3382
 
3420
3383
  ```typescript
@@ -3427,6 +3390,12 @@ public readonly nextjsStaticAssetsProps: NextjsStaticAssetsProps;
3427
3390
 
3428
3391
  ### NextjsGlobalContainersOverrides <a name="NextjsGlobalContainersOverrides" id="cdk-nextjs.NextjsGlobalContainersOverrides"></a>
3429
3392
 
3393
+ Overrides for `NextjsGlobalContainers`.
3394
+
3395
+ Overrides are lower level than
3396
+ props and are passed directly to CDK Constructs giving you more control. It's
3397
+ recommended to use caution and review source code so you know how they're used.
3398
+
3430
3399
  #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsGlobalContainersOverrides.Initializer"></a>
3431
3400
 
3432
3401
  ```typescript
@@ -3442,11 +3411,11 @@ const nextjsGlobalContainersOverrides: NextjsGlobalContainersOverrides = { ... }
3442
3411
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsAssetsDeployment">nextjsAssetsDeployment</a></code> | <code><a href="#cdk-nextjs.NextjsAssetDeploymentOverrides">NextjsAssetDeploymentOverrides</a></code> | *No description.* |
3443
3412
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsBuild">nextjsBuild</a></code> | <code><a href="#cdk-nextjs.NextjsBuildOverrides">NextjsBuildOverrides</a></code> | *No description.* |
3444
3413
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsFileSystem">nextjsFileSystem</a></code> | <code><a href="#cdk-nextjs.NextjsFileSystemOverrides">NextjsFileSystemOverrides</a></code> | *No description.* |
3414
+ | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | *No description.* |
3445
3415
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsVpc">nextjsVpc</a></code> | <code><a href="#cdk-nextjs.NextjsVpcOverrides">NextjsVpcOverrides</a></code> | *No description.* |
3446
3416
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsContainers">nextjsContainers</a></code> | <code><a href="#cdk-nextjs.NextjsContainersOverrides">NextjsContainersOverrides</a></code> | *No description.* |
3447
3417
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsDistribution">nextjsDistribution</a></code> | <code><a href="#cdk-nextjs.NextjsDistributionOverrides">NextjsDistributionOverrides</a></code> | *No description.* |
3448
3418
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsGlobalContainers">nextjsGlobalContainers</a></code> | <code><a href="#cdk-nextjs.NextjsGlobalContainersConstructOverrides">NextjsGlobalContainersConstructOverrides</a></code> | *No description.* |
3449
- | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsInvalidation">nextjsInvalidation</a></code> | <code><a href="#cdk-nextjs.NextjsInvalidationOverrides">NextjsInvalidationOverrides</a></code> | *No description.* |
3450
3419
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsStaticAssets">nextjsStaticAssets</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsOverrides">NextjsStaticAssetsOverrides</a></code> | *No description.* |
3451
3420
 
3452
3421
  ---
@@ -3481,6 +3450,16 @@ public readonly nextjsFileSystem: NextjsFileSystemOverrides;
3481
3450
 
3482
3451
  ---
3483
3452
 
3453
+ ##### `nextjsPostDeploy`<sup>Optional</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsPostDeploy"></a>
3454
+
3455
+ ```typescript
3456
+ public readonly nextjsPostDeploy: NextjsPostDeployOverrides;
3457
+ ```
3458
+
3459
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a>
3460
+
3461
+ ---
3462
+
3484
3463
  ##### `nextjsVpc`<sup>Optional</sup> <a name="nextjsVpc" id="cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsVpc"></a>
3485
3464
 
3486
3465
  ```typescript
@@ -3521,16 +3500,6 @@ public readonly nextjsGlobalContainers: NextjsGlobalContainersConstructOverrides
3521
3500
 
3522
3501
  ---
3523
3502
 
3524
- ##### `nextjsInvalidation`<sup>Optional</sup> <a name="nextjsInvalidation" id="cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsInvalidation"></a>
3525
-
3526
- ```typescript
3527
- public readonly nextjsInvalidation: NextjsInvalidationOverrides;
3528
- ```
3529
-
3530
- - *Type:* <a href="#cdk-nextjs.NextjsInvalidationOverrides">NextjsInvalidationOverrides</a>
3531
-
3532
- ---
3533
-
3534
3503
  ##### `nextjsStaticAssets`<sup>Optional</sup> <a name="nextjsStaticAssets" id="cdk-nextjs.NextjsGlobalContainersOverrides.property.nextjsStaticAssets"></a>
3535
3504
 
3536
3505
  ```typescript
@@ -3555,10 +3524,11 @@ const nextjsGlobalContainersProps: NextjsGlobalContainersProps = { ... }
3555
3524
 
3556
3525
  | **Name** | **Type** | **Description** |
3557
3526
  | --- | --- | --- |
3558
- | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}. |
3527
+ | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}. |
3559
3528
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | Path to API Route Handler that returns HTTP 200 to ensure compute health. |
3560
3529
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.buildCommand">buildCommand</a></code> | <code>string</code> | Command to generate optimized version of your Next.js app in container; |
3561
- | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | Use this if building in monorepo. |
3530
+ | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | Use this if building in monorepo. |
3531
+ | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
3562
3532
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.basePath">basePath</a></code> | <code>string</code> | Prefix to the URI path the app will be served at. |
3563
3533
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.Distribution</code> | Bring your own distribution. |
3564
3534
  | <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides">NextjsGlobalContainersOverrides</a></code> | Override props of any construct. |
@@ -3573,14 +3543,20 @@ public readonly buildContext: string;
3573
3543
 
3574
3544
  - *Type:* string
3575
3545
 
3576
- [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}.
3546
+ [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}.
3547
+
3548
+ Note, by default cdk-nextjs' `builder.Dockerfile` is used to build your
3549
+ Next.js app. You can customize this by specifying `overrides.{nextjs...}.nextjsBuildProps.builderImageProps.file`.
3550
+ If you override the default, then you are responsible for ensuring the
3551
+ Dockerfile is in the build context directory before cdk-nextjs construct
3552
+ is instantiated.
3577
3553
 
3578
3554
  ---
3579
3555
 
3580
3556
  *Example*
3581
3557
 
3582
3558
  ```typescript
3583
- fileURLToPath(new URL("../..", import.meta.url)) (monorepo)
3559
+ join(import.meta.dirname, "..") (monorepo)
3584
3560
  ```
3585
3561
 
3586
3562
 
@@ -3621,10 +3597,10 @@ Command to generate optimized version of your Next.js app in container;
3621
3597
 
3622
3598
  ---
3623
3599
 
3624
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsGlobalContainersProps.property.relativePathToWorkspace"></a>
3600
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.NextjsGlobalContainersProps.property.relativePathToPackage"></a>
3625
3601
 
3626
3602
  ```typescript
3627
- public readonly relativePathToWorkspace: string;
3603
+ public readonly relativePathToPackage: string;
3628
3604
  ```
3629
3605
 
3630
3606
  - *Type:* string
@@ -3632,7 +3608,7 @@ public readonly relativePathToWorkspace: string;
3632
3608
  Use this if building in monorepo.
3633
3609
 
3634
3610
  This is the relative path from
3635
- {@link NextjsBaseProps.buildContext} or root workspace to nested workspace
3611
+ {@link NextjsBaseProps.buildContext} or root workspace to nested package
3636
3612
  containing Next.js app. See example below:
3637
3613
 
3638
3614
  Let's say you have a monorepo with the following folder structure:
@@ -3643,15 +3619,14 @@ Let's say you have a monorepo with the following folder structure:
3643
3619
  - package.json (root)
3644
3620
 
3645
3621
  And your Next.js app directory is the ui folder. Then you would set {@link NextjsBaseProps.buildContext}
3646
- to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToWorkspace}
3622
+ to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToPackage}
3647
3623
  to `"./packages/ui"`.
3648
3624
 
3649
3625
  Note, setting {@link NextjsBaseProps.buildContext} to the root of your
3650
3626
  monorepo will invalidate container runtime (i.e. docker) build cache when any file is
3651
3627
  changed in your monorepo. This is slows down deployments. Checkout how you
3652
3628
  can use [turbo](https://turbo.build/) in [Deploying with Docker Guide](https://turbo.build/repo/docs/handbook/deploying-with-docker)
3653
- to achieve better build caching. It's as easy as running
3654
- `turbo prune my-app --docker` - no config file required.
3629
+ in the cdk-nextjs/examples/turbo.
3655
3630
 
3656
3631
  ---
3657
3632
 
@@ -3662,6 +3637,18 @@ to achieve better build caching. It's as easy as running
3662
3637
  ```
3663
3638
 
3664
3639
 
3640
+ ##### ~~`relativePathToWorkspace`~~<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsGlobalContainersProps.property.relativePathToWorkspace"></a>
3641
+
3642
+ - *Deprecated:* use relativePathToPackage
3643
+
3644
+ ```typescript
3645
+ public readonly relativePathToWorkspace: string;
3646
+ ```
3647
+
3648
+ - *Type:* string
3649
+
3650
+ ---
3651
+
3665
3652
  ##### `basePath`<sup>Optional</sup> <a name="basePath" id="cdk-nextjs.NextjsGlobalContainersProps.property.basePath"></a>
3666
3653
 
3667
3654
  ```typescript
@@ -3728,11 +3715,10 @@ const nextjsGlobalFunctionsConstructOverrides: NextjsGlobalFunctionsConstructOve
3728
3715
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsAssetsDeploymentProps">nextjsAssetsDeploymentProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps">OptionalNextjsAssetsDeploymentProps</a></code> | *No description.* |
3729
3716
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsBuildProps">nextjsBuildProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a></code> | *No description.* |
3730
3717
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsFileSystemProps">nextjsFileSystemProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsFileSystemProps">OptionalNextjsFileSystemProps</a></code> | *No description.* |
3718
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsPostDeployProps">nextjsPostDeployProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a></code> | *No description.* |
3731
3719
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsVpcProps">nextjsVpcProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsVpcProps">OptionalNextjsVpcProps</a></code> | *No description.* |
3732
3720
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsDistributionProps">nextjsDistributionProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps">OptionalNextjsDistributionProps</a></code> | *No description.* |
3733
3721
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsFunctionsProps">nextjsFunctionsProps</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsProps">NextjsFunctionsProps</a></code> | *No description.* |
3734
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsInvalidationProps">nextjsInvalidationProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsInvalidationProps">OptionalNextjsInvalidationProps</a></code> | *No description.* |
3735
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsRevalidationProps">nextjsRevalidationProps</a></code> | <code><a href="#cdk-nextjs.NextjsRevalidationProps">NextjsRevalidationProps</a></code> | *No description.* |
3736
3722
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsStaticAssetsProps">nextjsStaticAssetsProps</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsProps">NextjsStaticAssetsProps</a></code> | *No description.* |
3737
3723
 
3738
3724
  ---
@@ -3767,6 +3753,16 @@ public readonly nextjsFileSystemProps: OptionalNextjsFileSystemProps;
3767
3753
 
3768
3754
  ---
3769
3755
 
3756
+ ##### `nextjsPostDeployProps`<sup>Optional</sup> <a name="nextjsPostDeployProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsPostDeployProps"></a>
3757
+
3758
+ ```typescript
3759
+ public readonly nextjsPostDeployProps: OptionalNextjsPostDeployProps;
3760
+ ```
3761
+
3762
+ - *Type:* <a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a>
3763
+
3764
+ ---
3765
+
3770
3766
  ##### `nextjsVpcProps`<sup>Optional</sup> <a name="nextjsVpcProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsVpcProps"></a>
3771
3767
 
3772
3768
  ```typescript
@@ -3797,26 +3793,6 @@ public readonly nextjsFunctionsProps: NextjsFunctionsProps;
3797
3793
 
3798
3794
  ---
3799
3795
 
3800
- ##### `nextjsInvalidationProps`<sup>Optional</sup> <a name="nextjsInvalidationProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsInvalidationProps"></a>
3801
-
3802
- ```typescript
3803
- public readonly nextjsInvalidationProps: OptionalNextjsInvalidationProps;
3804
- ```
3805
-
3806
- - *Type:* <a href="#cdk-nextjs.OptionalNextjsInvalidationProps">OptionalNextjsInvalidationProps</a>
3807
-
3808
- ---
3809
-
3810
- ##### `nextjsRevalidationProps`<sup>Optional</sup> <a name="nextjsRevalidationProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsRevalidationProps"></a>
3811
-
3812
- ```typescript
3813
- public readonly nextjsRevalidationProps: NextjsRevalidationProps;
3814
- ```
3815
-
3816
- - *Type:* <a href="#cdk-nextjs.NextjsRevalidationProps">NextjsRevalidationProps</a>
3817
-
3818
- ---
3819
-
3820
3796
  ##### `nextjsStaticAssetsProps`<sup>Optional</sup> <a name="nextjsStaticAssetsProps" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.property.nextjsStaticAssetsProps"></a>
3821
3797
 
3822
3798
  ```typescript
@@ -3829,6 +3805,12 @@ public readonly nextjsStaticAssetsProps: NextjsStaticAssetsProps;
3829
3805
 
3830
3806
  ### NextjsGlobalFunctionsOverrides <a name="NextjsGlobalFunctionsOverrides" id="cdk-nextjs.NextjsGlobalFunctionsOverrides"></a>
3831
3807
 
3808
+ Overrides for `NextjsGlobalFunctions`.
3809
+
3810
+ Overrides are lower level than
3811
+ props and are passed directly to CDK Constructs giving you more control. It's
3812
+ recommended to use caution and review source code so you know how they're used.
3813
+
3832
3814
  #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.Initializer"></a>
3833
3815
 
3834
3816
  ```typescript
@@ -3844,12 +3826,11 @@ const nextjsGlobalFunctionsOverrides: NextjsGlobalFunctionsOverrides = { ... }
3844
3826
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsAssetsDeployment">nextjsAssetsDeployment</a></code> | <code><a href="#cdk-nextjs.NextjsAssetDeploymentOverrides">NextjsAssetDeploymentOverrides</a></code> | *No description.* |
3845
3827
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsBuild">nextjsBuild</a></code> | <code><a href="#cdk-nextjs.NextjsBuildOverrides">NextjsBuildOverrides</a></code> | *No description.* |
3846
3828
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsFileSystem">nextjsFileSystem</a></code> | <code><a href="#cdk-nextjs.NextjsFileSystemOverrides">NextjsFileSystemOverrides</a></code> | *No description.* |
3829
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | *No description.* |
3847
3830
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsVpc">nextjsVpc</a></code> | <code><a href="#cdk-nextjs.NextjsVpcOverrides">NextjsVpcOverrides</a></code> | *No description.* |
3848
3831
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsDistribution">nextjsDistribution</a></code> | <code><a href="#cdk-nextjs.NextjsDistributionOverrides">NextjsDistributionOverrides</a></code> | *No description.* |
3849
3832
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsFunctions">nextjsFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionsOverrides">NextjsFunctionsOverrides</a></code> | *No description.* |
3850
3833
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsGlobalFunctions">nextjsGlobalFunctions</a></code> | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsConstructOverrides">NextjsGlobalFunctionsConstructOverrides</a></code> | *No description.* |
3851
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsInvalidation">nextjsInvalidation</a></code> | <code><a href="#cdk-nextjs.NextjsInvalidationOverrides">NextjsInvalidationOverrides</a></code> | *No description.* |
3852
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsRevalidation">nextjsRevalidation</a></code> | <code><a href="#cdk-nextjs.NextjsRevalidationOverrides">NextjsRevalidationOverrides</a></code> | *No description.* |
3853
3834
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsStaticAssets">nextjsStaticAssets</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssetsOverrides">NextjsStaticAssetsOverrides</a></code> | *No description.* |
3854
3835
 
3855
3836
  ---
@@ -3884,6 +3865,16 @@ public readonly nextjsFileSystem: NextjsFileSystemOverrides;
3884
3865
 
3885
3866
  ---
3886
3867
 
3868
+ ##### `nextjsPostDeploy`<sup>Optional</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsPostDeploy"></a>
3869
+
3870
+ ```typescript
3871
+ public readonly nextjsPostDeploy: NextjsPostDeployOverrides;
3872
+ ```
3873
+
3874
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a>
3875
+
3876
+ ---
3877
+
3887
3878
  ##### `nextjsVpc`<sup>Optional</sup> <a name="nextjsVpc" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsVpc"></a>
3888
3879
 
3889
3880
  ```typescript
@@ -3924,26 +3915,6 @@ public readonly nextjsGlobalFunctions: NextjsGlobalFunctionsConstructOverrides;
3924
3915
 
3925
3916
  ---
3926
3917
 
3927
- ##### `nextjsInvalidation`<sup>Optional</sup> <a name="nextjsInvalidation" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsInvalidation"></a>
3928
-
3929
- ```typescript
3930
- public readonly nextjsInvalidation: NextjsInvalidationOverrides;
3931
- ```
3932
-
3933
- - *Type:* <a href="#cdk-nextjs.NextjsInvalidationOverrides">NextjsInvalidationOverrides</a>
3934
-
3935
- ---
3936
-
3937
- ##### `nextjsRevalidation`<sup>Optional</sup> <a name="nextjsRevalidation" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsRevalidation"></a>
3938
-
3939
- ```typescript
3940
- public readonly nextjsRevalidation: NextjsRevalidationOverrides;
3941
- ```
3942
-
3943
- - *Type:* <a href="#cdk-nextjs.NextjsRevalidationOverrides">NextjsRevalidationOverrides</a>
3944
-
3945
- ---
3946
-
3947
3918
  ##### `nextjsStaticAssets`<sup>Optional</sup> <a name="nextjsStaticAssets" id="cdk-nextjs.NextjsGlobalFunctionsOverrides.property.nextjsStaticAssets"></a>
3948
3919
 
3949
3920
  ```typescript
@@ -3968,10 +3939,11 @@ const nextjsGlobalFunctionsProps: NextjsGlobalFunctionsProps = { ... }
3968
3939
 
3969
3940
  | **Name** | **Type** | **Description** |
3970
3941
  | --- | --- | --- |
3971
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}. |
3942
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}. |
3972
3943
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | Path to API Route Handler that returns HTTP 200 to ensure compute health. |
3973
3944
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.buildCommand">buildCommand</a></code> | <code>string</code> | Command to generate optimized version of your Next.js app in container; |
3974
- | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | Use this if building in monorepo. |
3945
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | Use this if building in monorepo. |
3946
+ | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
3975
3947
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.basePath">basePath</a></code> | <code>string</code> | Prefix to the URI path the app will be served at. |
3976
3948
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.Distribution</code> | Bring your own distribution. |
3977
3949
  | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides">NextjsGlobalFunctionsOverrides</a></code> | Override props of any construct. |
@@ -3986,14 +3958,20 @@ public readonly buildContext: string;
3986
3958
 
3987
3959
  - *Type:* string
3988
3960
 
3989
- [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}.
3961
+ [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}.
3962
+
3963
+ Note, by default cdk-nextjs' `builder.Dockerfile` is used to build your
3964
+ Next.js app. You can customize this by specifying `overrides.{nextjs...}.nextjsBuildProps.builderImageProps.file`.
3965
+ If you override the default, then you are responsible for ensuring the
3966
+ Dockerfile is in the build context directory before cdk-nextjs construct
3967
+ is instantiated.
3990
3968
 
3991
3969
  ---
3992
3970
 
3993
3971
  *Example*
3994
3972
 
3995
3973
  ```typescript
3996
- fileURLToPath(new URL("../..", import.meta.url)) (monorepo)
3974
+ join(import.meta.dirname, "..") (monorepo)
3997
3975
  ```
3998
3976
 
3999
3977
 
@@ -4034,10 +4012,10 @@ Command to generate optimized version of your Next.js app in container;
4034
4012
 
4035
4013
  ---
4036
4014
 
4037
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsGlobalFunctionsProps.property.relativePathToWorkspace"></a>
4015
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.NextjsGlobalFunctionsProps.property.relativePathToPackage"></a>
4038
4016
 
4039
4017
  ```typescript
4040
- public readonly relativePathToWorkspace: string;
4018
+ public readonly relativePathToPackage: string;
4041
4019
  ```
4042
4020
 
4043
4021
  - *Type:* string
@@ -4045,7 +4023,7 @@ public readonly relativePathToWorkspace: string;
4045
4023
  Use this if building in monorepo.
4046
4024
 
4047
4025
  This is the relative path from
4048
- {@link NextjsBaseProps.buildContext} or root workspace to nested workspace
4026
+ {@link NextjsBaseProps.buildContext} or root workspace to nested package
4049
4027
  containing Next.js app. See example below:
4050
4028
 
4051
4029
  Let's say you have a monorepo with the following folder structure:
@@ -4056,15 +4034,14 @@ Let's say you have a monorepo with the following folder structure:
4056
4034
  - package.json (root)
4057
4035
 
4058
4036
  And your Next.js app directory is the ui folder. Then you would set {@link NextjsBaseProps.buildContext}
4059
- to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToWorkspace}
4037
+ to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToPackage}
4060
4038
  to `"./packages/ui"`.
4061
4039
 
4062
4040
  Note, setting {@link NextjsBaseProps.buildContext} to the root of your
4063
4041
  monorepo will invalidate container runtime (i.e. docker) build cache when any file is
4064
4042
  changed in your monorepo. This is slows down deployments. Checkout how you
4065
4043
  can use [turbo](https://turbo.build/) in [Deploying with Docker Guide](https://turbo.build/repo/docs/handbook/deploying-with-docker)
4066
- to achieve better build caching. It's as easy as running
4067
- `turbo prune my-app --docker` - no config file required.
4044
+ in the cdk-nextjs/examples/turbo.
4068
4045
 
4069
4046
  ---
4070
4047
 
@@ -4075,6 +4052,18 @@ to achieve better build caching. It's as easy as running
4075
4052
  ```
4076
4053
 
4077
4054
 
4055
+ ##### ~~`relativePathToWorkspace`~~<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsGlobalFunctionsProps.property.relativePathToWorkspace"></a>
4056
+
4057
+ - *Deprecated:* use relativePathToPackage
4058
+
4059
+ ```typescript
4060
+ public readonly relativePathToWorkspace: string;
4061
+ ```
4062
+
4063
+ - *Type:* string
4064
+
4065
+ ---
4066
+
4078
4067
  ##### `basePath`<sup>Optional</sup> <a name="basePath" id="cdk-nextjs.NextjsGlobalFunctionsProps.property.basePath"></a>
4079
4068
 
4080
4069
  ```typescript
@@ -4124,54 +4113,142 @@ Override props of any construct.
4124
4113
 
4125
4114
  ---
4126
4115
 
4127
- ### NextjsInvalidationOverrides <a name="NextjsInvalidationOverrides" id="cdk-nextjs.NextjsInvalidationOverrides"></a>
4116
+ ### NextjsPostDeployOverrides <a name="NextjsPostDeployOverrides" id="cdk-nextjs.NextjsPostDeployOverrides"></a>
4128
4117
 
4129
- #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsInvalidationOverrides.Initializer"></a>
4118
+ #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsPostDeployOverrides.Initializer"></a>
4130
4119
 
4131
4120
  ```typescript
4132
- import { NextjsInvalidationOverrides } from 'cdk-nextjs'
4121
+ import { NextjsPostDeployOverrides } from 'cdk-nextjs'
4133
4122
 
4134
- const nextjsInvalidationOverrides: NextjsInvalidationOverrides = { ... }
4123
+ const nextjsPostDeployOverrides: NextjsPostDeployOverrides = { ... }
4135
4124
  ```
4136
4125
 
4137
4126
  #### Properties <a name="Properties" id="Properties"></a>
4138
4127
 
4139
4128
  | **Name** | **Type** | **Description** |
4140
4129
  | --- | --- | --- |
4141
- | <code><a href="#cdk-nextjs.NextjsInvalidationOverrides.property.awsCustomResourceProps">awsCustomResourceProps</a></code> | <code>aws-cdk-lib.custom_resources.AwsCustomResourceProps</code> | *No description.* |
4130
+ | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides.property.customResourceProperties">customResourceProperties</a></code> | <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties">OptionalPostDeployCustomResourceProperties</a></code> | Properties passed into custom resource that are passed to Lambda event handler. |
4131
+ | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides.property.customResourceProps">customResourceProps</a></code> | <code><a href="#cdk-nextjs.OptionalCustomResourceProps">OptionalCustomResourceProps</a></code> | Props that define the custom resource. |
4132
+ | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides.property.functionProps">functionProps</a></code> | <code><a href="#cdk-nextjs.OptionalFunctionProps">OptionalFunctionProps</a></code> | *No description.* |
4142
4133
 
4143
4134
  ---
4144
4135
 
4145
- ##### `awsCustomResourceProps`<sup>Optional</sup> <a name="awsCustomResourceProps" id="cdk-nextjs.NextjsInvalidationOverrides.property.awsCustomResourceProps"></a>
4136
+ ##### `customResourceProperties`<sup>Optional</sup> <a name="customResourceProperties" id="cdk-nextjs.NextjsPostDeployOverrides.property.customResourceProperties"></a>
4146
4137
 
4147
4138
  ```typescript
4148
- public readonly awsCustomResourceProps: AwsCustomResourceProps;
4139
+ public readonly customResourceProperties: OptionalPostDeployCustomResourceProperties;
4149
4140
  ```
4150
4141
 
4151
- - *Type:* aws-cdk-lib.custom_resources.AwsCustomResourceProps
4142
+ - *Type:* <a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties">OptionalPostDeployCustomResourceProperties</a>
4143
+
4144
+ Properties passed into custom resource that are passed to Lambda event handler.
4152
4145
 
4153
4146
  ---
4154
4147
 
4155
- ### NextjsInvalidationProps <a name="NextjsInvalidationProps" id="cdk-nextjs.NextjsInvalidationProps"></a>
4148
+ ##### `customResourceProps`<sup>Optional</sup> <a name="customResourceProps" id="cdk-nextjs.NextjsPostDeployOverrides.property.customResourceProps"></a>
4149
+
4150
+ ```typescript
4151
+ public readonly customResourceProps: OptionalCustomResourceProps;
4152
+ ```
4153
+
4154
+ - *Type:* <a href="#cdk-nextjs.OptionalCustomResourceProps">OptionalCustomResourceProps</a>
4156
4155
 
4157
- #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsInvalidationProps.Initializer"></a>
4156
+ Props that define the custom resource.
4157
+
4158
+ ---
4159
+
4160
+ ##### `functionProps`<sup>Optional</sup> <a name="functionProps" id="cdk-nextjs.NextjsPostDeployOverrides.property.functionProps"></a>
4158
4161
 
4159
4162
  ```typescript
4160
- import { NextjsInvalidationProps } from 'cdk-nextjs'
4163
+ public readonly functionProps: OptionalFunctionProps;
4164
+ ```
4161
4165
 
4162
- const nextjsInvalidationProps: NextjsInvalidationProps = { ... }
4166
+ - *Type:* <a href="#cdk-nextjs.OptionalFunctionProps">OptionalFunctionProps</a>
4167
+
4168
+ ---
4169
+
4170
+ ### NextjsPostDeployProps <a name="NextjsPostDeployProps" id="cdk-nextjs.NextjsPostDeployProps"></a>
4171
+
4172
+ #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsPostDeployProps.Initializer"></a>
4173
+
4174
+ ```typescript
4175
+ import { NextjsPostDeployProps } from 'cdk-nextjs'
4176
+
4177
+ const nextjsPostDeployProps: NextjsPostDeployProps = { ... }
4163
4178
  ```
4164
4179
 
4165
4180
  #### Properties <a name="Properties" id="Properties"></a>
4166
4181
 
4167
4182
  | **Name** | **Type** | **Description** |
4168
4183
  | --- | --- | --- |
4169
- | <code><a href="#cdk-nextjs.NextjsInvalidationProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.IDistribution</code> | CloudFront Distribution to invalidate. |
4170
- | <code><a href="#cdk-nextjs.NextjsInvalidationProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsInvalidationOverrides">NextjsInvalidationOverrides</a></code> | Override props for every construct. |
4184
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
4185
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.buildId">buildId</a></code> | <code>string</code> | *No description.* |
4186
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.buildImageDigest">buildImageDigest</a></code> | <code>string</code> | *No description.* |
4187
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
4188
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.debug">debug</a></code> | <code>boolean</code> | If true, logs details in custom resource lambda. |
4189
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.IDistribution</code> | CloudFront Distribution to invalidate. |
4190
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | Override props for every construct. |
4191
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | *No description.* |
4192
+ | <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.Bucket</code> | Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`. |
4193
+
4194
+ ---
4195
+
4196
+ ##### `accessPoint`<sup>Required</sup> <a name="accessPoint" id="cdk-nextjs.NextjsPostDeployProps.property.accessPoint"></a>
4197
+
4198
+ ```typescript
4199
+ public readonly accessPoint: AccessPoint;
4200
+ ```
4201
+
4202
+ - *Type:* aws-cdk-lib.aws_efs.AccessPoint
4203
+
4204
+ ---
4205
+
4206
+ ##### `buildId`<sup>Required</sup> <a name="buildId" id="cdk-nextjs.NextjsPostDeployProps.property.buildId"></a>
4207
+
4208
+ ```typescript
4209
+ public readonly buildId: string;
4210
+ ```
4211
+
4212
+ - *Type:* string
4171
4213
 
4172
4214
  ---
4173
4215
 
4174
- ##### `distribution`<sup>Required</sup> <a name="distribution" id="cdk-nextjs.NextjsInvalidationProps.property.distribution"></a>
4216
+ ##### `buildImageDigest`<sup>Required</sup> <a name="buildImageDigest" id="cdk-nextjs.NextjsPostDeployProps.property.buildImageDigest"></a>
4217
+
4218
+ ```typescript
4219
+ public readonly buildImageDigest: string;
4220
+ ```
4221
+
4222
+ - *Type:* string
4223
+
4224
+ > [{@link NextjsBuild.buildImageDigest }]({@link NextjsBuild.buildImageDigest })
4225
+
4226
+ ---
4227
+
4228
+ ##### `vpc`<sup>Required</sup> <a name="vpc" id="cdk-nextjs.NextjsPostDeployProps.property.vpc"></a>
4229
+
4230
+ ```typescript
4231
+ public readonly vpc: IVpc;
4232
+ ```
4233
+
4234
+ - *Type:* aws-cdk-lib.aws_ec2.IVpc
4235
+
4236
+ ---
4237
+
4238
+ ##### `debug`<sup>Optional</sup> <a name="debug" id="cdk-nextjs.NextjsPostDeployProps.property.debug"></a>
4239
+
4240
+ ```typescript
4241
+ public readonly debug: boolean;
4242
+ ```
4243
+
4244
+ - *Type:* boolean
4245
+ - *Default:* true
4246
+
4247
+ If true, logs details in custom resource lambda.
4248
+
4249
+ ---
4250
+
4251
+ ##### `distribution`<sup>Optional</sup> <a name="distribution" id="cdk-nextjs.NextjsPostDeployProps.property.distribution"></a>
4175
4252
 
4176
4253
  ```typescript
4177
4254
  public readonly distribution: IDistribution;
@@ -4183,18 +4260,42 @@ CloudFront Distribution to invalidate.
4183
4260
 
4184
4261
  ---
4185
4262
 
4186
- ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsInvalidationProps.property.overrides"></a>
4263
+ ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsPostDeployProps.property.overrides"></a>
4187
4264
 
4188
4265
  ```typescript
4189
- public readonly overrides: NextjsInvalidationOverrides;
4266
+ public readonly overrides: NextjsPostDeployOverrides;
4190
4267
  ```
4191
4268
 
4192
- - *Type:* <a href="#cdk-nextjs.NextjsInvalidationOverrides">NextjsInvalidationOverrides</a>
4269
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a>
4193
4270
 
4194
4271
  Override props for every construct.
4195
4272
 
4196
4273
  ---
4197
4274
 
4275
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.NextjsPostDeployProps.property.relativePathToPackage"></a>
4276
+
4277
+ ```typescript
4278
+ public readonly relativePathToPackage: string;
4279
+ ```
4280
+
4281
+ - *Type:* string
4282
+
4283
+ > [{@link NextjsBaseProps.relativePathToPackage }]({@link NextjsBaseProps.relativePathToPackage })
4284
+
4285
+ ---
4286
+
4287
+ ##### `staticAssetsBucket`<sup>Optional</sup> <a name="staticAssetsBucket" id="cdk-nextjs.NextjsPostDeployProps.property.staticAssetsBucket"></a>
4288
+
4289
+ ```typescript
4290
+ public readonly staticAssetsBucket: Bucket;
4291
+ ```
4292
+
4293
+ - *Type:* aws-cdk-lib.aws_s3.Bucket
4294
+
4295
+ Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`.
4296
+
4297
+ ---
4298
+
4198
4299
  ### NextjsRegionalContainersConstructOverrides <a name="NextjsRegionalContainersConstructOverrides" id="cdk-nextjs.NextjsRegionalContainersConstructOverrides"></a>
4199
4300
 
4200
4301
  #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsRegionalContainersConstructOverrides.Initializer"></a>
@@ -4212,6 +4313,7 @@ const nextjsRegionalContainersConstructOverrides: NextjsRegionalContainersConstr
4212
4313
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsAssetsDeploymentProps">nextjsAssetsDeploymentProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps">OptionalNextjsAssetsDeploymentProps</a></code> | *No description.* |
4213
4314
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsBuildProps">nextjsBuildProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps">OptionalNextjsBuildProps</a></code> | *No description.* |
4214
4315
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsFileSystemProps">nextjsFileSystemProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsFileSystemProps">OptionalNextjsFileSystemProps</a></code> | *No description.* |
4316
+ | <code><a href="#cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsPostDeployProps">nextjsPostDeployProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a></code> | *No description.* |
4215
4317
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsVpcProps">nextjsVpcProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsVpcProps">OptionalNextjsVpcProps</a></code> | *No description.* |
4216
4318
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsContainerProps">nextjsContainerProps</a></code> | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps">OptionalNextjsContainersProps</a></code> | *No description.* |
4217
4319
 
@@ -4247,6 +4349,16 @@ public readonly nextjsFileSystemProps: OptionalNextjsFileSystemProps;
4247
4349
 
4248
4350
  ---
4249
4351
 
4352
+ ##### `nextjsPostDeployProps`<sup>Optional</sup> <a name="nextjsPostDeployProps" id="cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsPostDeployProps"></a>
4353
+
4354
+ ```typescript
4355
+ public readonly nextjsPostDeployProps: OptionalNextjsPostDeployProps;
4356
+ ```
4357
+
4358
+ - *Type:* <a href="#cdk-nextjs.OptionalNextjsPostDeployProps">OptionalNextjsPostDeployProps</a>
4359
+
4360
+ ---
4361
+
4250
4362
  ##### `nextjsVpcProps`<sup>Optional</sup> <a name="nextjsVpcProps" id="cdk-nextjs.NextjsRegionalContainersConstructOverrides.property.nextjsVpcProps"></a>
4251
4363
 
4252
4364
  ```typescript
@@ -4269,6 +4381,12 @@ public readonly nextjsContainerProps: OptionalNextjsContainersProps;
4269
4381
 
4270
4382
  ### NextjsRegionalContainersOverrides <a name="NextjsRegionalContainersOverrides" id="cdk-nextjs.NextjsRegionalContainersOverrides"></a>
4271
4383
 
4384
+ Overrides for `NextjsRegionalContainers`.
4385
+
4386
+ Overrides are lower level than
4387
+ props and are passed directly to CDK Constructs giving you more control. It's
4388
+ recommended to use caution and review source code so you know how they're used.
4389
+
4272
4390
  #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsRegionalContainersOverrides.Initializer"></a>
4273
4391
 
4274
4392
  ```typescript
@@ -4284,6 +4402,7 @@ const nextjsRegionalContainersOverrides: NextjsRegionalContainersOverrides = { .
4284
4402
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsAssetsDeployment">nextjsAssetsDeployment</a></code> | <code><a href="#cdk-nextjs.NextjsAssetDeploymentOverrides">NextjsAssetDeploymentOverrides</a></code> | *No description.* |
4285
4403
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsBuild">nextjsBuild</a></code> | <code><a href="#cdk-nextjs.NextjsBuildOverrides">NextjsBuildOverrides</a></code> | *No description.* |
4286
4404
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsFileSystem">nextjsFileSystem</a></code> | <code><a href="#cdk-nextjs.NextjsFileSystemOverrides">NextjsFileSystemOverrides</a></code> | *No description.* |
4405
+ | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsPostDeploy">nextjsPostDeploy</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | *No description.* |
4287
4406
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsVpc">nextjsVpc</a></code> | <code><a href="#cdk-nextjs.NextjsVpcOverrides">NextjsVpcOverrides</a></code> | *No description.* |
4288
4407
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsContainers">nextjsContainers</a></code> | <code><a href="#cdk-nextjs.NextjsContainersOverrides">NextjsContainersOverrides</a></code> | *No description.* |
4289
4408
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsRegionalContainers">nextjsRegionalContainers</a></code> | <code><a href="#cdk-nextjs.NextjsRegionalContainersConstructOverrides">NextjsRegionalContainersConstructOverrides</a></code> | *No description.* |
@@ -4320,6 +4439,16 @@ public readonly nextjsFileSystem: NextjsFileSystemOverrides;
4320
4439
 
4321
4440
  ---
4322
4441
 
4442
+ ##### `nextjsPostDeploy`<sup>Optional</sup> <a name="nextjsPostDeploy" id="cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsPostDeploy"></a>
4443
+
4444
+ ```typescript
4445
+ public readonly nextjsPostDeploy: NextjsPostDeployOverrides;
4446
+ ```
4447
+
4448
+ - *Type:* <a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a>
4449
+
4450
+ ---
4451
+
4323
4452
  ##### `nextjsVpc`<sup>Optional</sup> <a name="nextjsVpc" id="cdk-nextjs.NextjsRegionalContainersOverrides.property.nextjsVpc"></a>
4324
4453
 
4325
4454
  ```typescript
@@ -4364,10 +4493,11 @@ const nextjsRegionalContainersProps: NextjsRegionalContainersProps = { ... }
4364
4493
 
4365
4494
  | **Name** | **Type** | **Description** |
4366
4495
  | --- | --- | --- |
4367
- | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}. |
4496
+ | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.buildContext">buildContext</a></code> | <code>string</code> | [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}. |
4368
4497
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | Path to API Route Handler that returns HTTP 200 to ensure compute health. |
4369
4498
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.buildCommand">buildCommand</a></code> | <code>string</code> | Command to generate optimized version of your Next.js app in container; |
4370
- | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | Use this if building in monorepo. |
4499
+ | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | Use this if building in monorepo. |
4500
+ | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
4371
4501
  | <code><a href="#cdk-nextjs.NextjsRegionalContainersProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsRegionalContainersOverrides">NextjsRegionalContainersOverrides</a></code> | Override props of any construct. |
4372
4502
 
4373
4503
  ---
@@ -4380,14 +4510,20 @@ public readonly buildContext: string;
4380
4510
 
4381
4511
  - *Type:* string
4382
4512
 
4383
- [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToWorkspace}.
4513
+ [Build context](https://docs.docker.com/build/building/context/) for `docker build`. This directory should contain your lockfile (i.e. pnpm-lock.yaml) for your Next.js app. If you're not in a monorepo, then this will be the same directory as your Next.js app. If you are in a monorepo, then this value should be the root of your monorepo. You then must pass the relative path to your Next.js app via {@link NextjsBaseProps.relativePathToPackage}.
4514
+
4515
+ Note, by default cdk-nextjs' `builder.Dockerfile` is used to build your
4516
+ Next.js app. You can customize this by specifying `overrides.{nextjs...}.nextjsBuildProps.builderImageProps.file`.
4517
+ If you override the default, then you are responsible for ensuring the
4518
+ Dockerfile is in the build context directory before cdk-nextjs construct
4519
+ is instantiated.
4384
4520
 
4385
4521
  ---
4386
4522
 
4387
4523
  *Example*
4388
4524
 
4389
4525
  ```typescript
4390
- fileURLToPath(new URL("../..", import.meta.url)) (monorepo)
4526
+ join(import.meta.dirname, "..") (monorepo)
4391
4527
  ```
4392
4528
 
4393
4529
 
@@ -4428,10 +4564,10 @@ Command to generate optimized version of your Next.js app in container;
4428
4564
 
4429
4565
  ---
4430
4566
 
4431
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsRegionalContainersProps.property.relativePathToWorkspace"></a>
4567
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.NextjsRegionalContainersProps.property.relativePathToPackage"></a>
4432
4568
 
4433
4569
  ```typescript
4434
- public readonly relativePathToWorkspace: string;
4570
+ public readonly relativePathToPackage: string;
4435
4571
  ```
4436
4572
 
4437
4573
  - *Type:* string
@@ -4439,7 +4575,7 @@ public readonly relativePathToWorkspace: string;
4439
4575
  Use this if building in monorepo.
4440
4576
 
4441
4577
  This is the relative path from
4442
- {@link NextjsBaseProps.buildContext} or root workspace to nested workspace
4578
+ {@link NextjsBaseProps.buildContext} or root workspace to nested package
4443
4579
  containing Next.js app. See example below:
4444
4580
 
4445
4581
  Let's say you have a monorepo with the following folder structure:
@@ -4450,15 +4586,14 @@ Let's say you have a monorepo with the following folder structure:
4450
4586
  - package.json (root)
4451
4587
 
4452
4588
  And your Next.js app directory is the ui folder. Then you would set {@link NextjsBaseProps.buildContext}
4453
- to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToWorkspace}
4589
+ to `"/absolute/path/to/my-monorepo"` and {@link NextjsBaseProps.relativePathToPackage}
4454
4590
  to `"./packages/ui"`.
4455
4591
 
4456
4592
  Note, setting {@link NextjsBaseProps.buildContext} to the root of your
4457
4593
  monorepo will invalidate container runtime (i.e. docker) build cache when any file is
4458
4594
  changed in your monorepo. This is slows down deployments. Checkout how you
4459
4595
  can use [turbo](https://turbo.build/) in [Deploying with Docker Guide](https://turbo.build/repo/docs/handbook/deploying-with-docker)
4460
- to achieve better build caching. It's as easy as running
4461
- `turbo prune my-app --docker` - no config file required.
4596
+ in the cdk-nextjs/examples/turbo.
4462
4597
 
4463
4598
  ---
4464
4599
 
@@ -4469,115 +4604,27 @@ to achieve better build caching. It's as easy as running
4469
4604
  ```
4470
4605
 
4471
4606
 
4472
- ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsRegionalContainersProps.property.overrides"></a>
4473
-
4474
- ```typescript
4475
- public readonly overrides: NextjsRegionalContainersOverrides;
4476
- ```
4477
-
4478
- - *Type:* <a href="#cdk-nextjs.NextjsRegionalContainersOverrides">NextjsRegionalContainersOverrides</a>
4479
-
4480
- Override props of any construct.
4481
-
4482
- ---
4483
-
4484
- ### NextjsRevalidationOverrides <a name="NextjsRevalidationOverrides" id="cdk-nextjs.NextjsRevalidationOverrides"></a>
4485
-
4486
- #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsRevalidationOverrides.Initializer"></a>
4487
-
4488
- ```typescript
4489
- import { NextjsRevalidationOverrides } from 'cdk-nextjs'
4490
-
4491
- const nextjsRevalidationOverrides: NextjsRevalidationOverrides = { ... }
4492
- ```
4493
-
4494
- #### Properties <a name="Properties" id="Properties"></a>
4495
-
4496
- | **Name** | **Type** | **Description** |
4497
- | --- | --- | --- |
4498
- | <code><a href="#cdk-nextjs.NextjsRevalidationOverrides.property.functionProps">functionProps</a></code> | <code><a href="#cdk-nextjs.OptionalFunctionProps">OptionalFunctionProps</a></code> | *No description.* |
4499
- | <code><a href="#cdk-nextjs.NextjsRevalidationOverrides.property.queueProps">queueProps</a></code> | <code>aws-cdk-lib.aws_sqs.QueueProps</code> | *No description.* |
4500
- | <code><a href="#cdk-nextjs.NextjsRevalidationOverrides.property.sqsEventSourceProps">sqsEventSourceProps</a></code> | <code>aws-cdk-lib.aws_lambda_event_sources.SqsEventSourceProps</code> | *No description.* |
4501
-
4502
- ---
4503
-
4504
- ##### `functionProps`<sup>Optional</sup> <a name="functionProps" id="cdk-nextjs.NextjsRevalidationOverrides.property.functionProps"></a>
4505
-
4506
- ```typescript
4507
- public readonly functionProps: OptionalFunctionProps;
4508
- ```
4509
-
4510
- - *Type:* <a href="#cdk-nextjs.OptionalFunctionProps">OptionalFunctionProps</a>
4511
-
4512
- ---
4607
+ ##### ~~`relativePathToWorkspace`~~<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.NextjsRegionalContainersProps.property.relativePathToWorkspace"></a>
4513
4608
 
4514
- ##### `queueProps`<sup>Optional</sup> <a name="queueProps" id="cdk-nextjs.NextjsRevalidationOverrides.property.queueProps"></a>
4609
+ - *Deprecated:* use relativePathToPackage
4515
4610
 
4516
4611
  ```typescript
4517
- public readonly queueProps: QueueProps;
4518
- ```
4519
-
4520
- - *Type:* aws-cdk-lib.aws_sqs.QueueProps
4521
-
4522
- ---
4523
-
4524
- ##### `sqsEventSourceProps`<sup>Optional</sup> <a name="sqsEventSourceProps" id="cdk-nextjs.NextjsRevalidationOverrides.property.sqsEventSourceProps"></a>
4525
-
4526
- ```typescript
4527
- public readonly sqsEventSourceProps: SqsEventSourceProps;
4528
- ```
4529
-
4530
- - *Type:* aws-cdk-lib.aws_lambda_event_sources.SqsEventSourceProps
4531
-
4532
- ---
4533
-
4534
- ### NextjsRevalidationProps <a name="NextjsRevalidationProps" id="cdk-nextjs.NextjsRevalidationProps"></a>
4535
-
4536
- #### Initializer <a name="Initializer" id="cdk-nextjs.NextjsRevalidationProps.Initializer"></a>
4537
-
4538
- ```typescript
4539
- import { NextjsRevalidationProps } from 'cdk-nextjs'
4540
-
4541
- const nextjsRevalidationProps: NextjsRevalidationProps = { ... }
4542
- ```
4543
-
4544
- #### Properties <a name="Properties" id="Properties"></a>
4545
-
4546
- | **Name** | **Type** | **Description** |
4547
- | --- | --- | --- |
4548
- | <code><a href="#cdk-nextjs.NextjsRevalidationProps.property.fn">fn</a></code> | <code>aws-cdk-lib.aws_lambda.Function</code> | *No description.* |
4549
- | <code><a href="#cdk-nextjs.NextjsRevalidationProps.property.previewModeId">previewModeId</a></code> | <code>string</code> | *No description.* |
4550
- | <code><a href="#cdk-nextjs.NextjsRevalidationProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsRevalidationOverrides">NextjsRevalidationOverrides</a></code> | *No description.* |
4551
-
4552
- ---
4553
-
4554
- ##### `fn`<sup>Required</sup> <a name="fn" id="cdk-nextjs.NextjsRevalidationProps.property.fn"></a>
4555
-
4556
- ```typescript
4557
- public readonly fn: Function;
4558
- ```
4559
-
4560
- - *Type:* aws-cdk-lib.aws_lambda.Function
4561
-
4562
- ---
4563
-
4564
- ##### `previewModeId`<sup>Required</sup> <a name="previewModeId" id="cdk-nextjs.NextjsRevalidationProps.property.previewModeId"></a>
4565
-
4566
- ```typescript
4567
- public readonly previewModeId: string;
4612
+ public readonly relativePathToWorkspace: string;
4568
4613
  ```
4569
4614
 
4570
4615
  - *Type:* string
4571
4616
 
4572
4617
  ---
4573
4618
 
4574
- ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsRevalidationProps.property.overrides"></a>
4619
+ ##### `overrides`<sup>Optional</sup> <a name="overrides" id="cdk-nextjs.NextjsRegionalContainersProps.property.overrides"></a>
4575
4620
 
4576
4621
  ```typescript
4577
- public readonly overrides: NextjsRevalidationOverrides;
4622
+ public readonly overrides: NextjsRegionalContainersOverrides;
4578
4623
  ```
4579
4624
 
4580
- - *Type:* <a href="#cdk-nextjs.NextjsRevalidationOverrides">NextjsRevalidationOverrides</a>
4625
+ - *Type:* <a href="#cdk-nextjs.NextjsRegionalContainersOverrides">NextjsRegionalContainersOverrides</a>
4626
+
4627
+ Override props of any construct.
4581
4628
 
4582
4629
  ---
4583
4630
 
@@ -5140,75 +5187,244 @@ If true CloudWatch Container Insights will be enabled for the cluster.
5140
5187
  public readonly containerInsightsV2: ContainerInsights;
5141
5188
  ```
5142
5189
 
5143
- - *Type:* aws-cdk-lib.aws_ecs.ContainerInsights
5144
- - *Default:* {@link ContainerInsights.DISABLED } This may be overridden by ECS account level settings.
5190
+ - *Type:* aws-cdk-lib.aws_ecs.ContainerInsights
5191
+ - *Default:* {@link ContainerInsights.DISABLED } This may be overridden by ECS account level settings.
5192
+
5193
+ The CloudWatch Container Insights configuration for the cluster.
5194
+
5195
+ ---
5196
+
5197
+ ##### `defaultCloudMapNamespace`<sup>Optional</sup> <a name="defaultCloudMapNamespace" id="cdk-nextjs.OptionalClusterProps.property.defaultCloudMapNamespace"></a>
5198
+
5199
+ ```typescript
5200
+ public readonly defaultCloudMapNamespace: CloudMapNamespaceOptions;
5201
+ ```
5202
+
5203
+ - *Type:* aws-cdk-lib.aws_ecs.CloudMapNamespaceOptions
5204
+ - *Default:* no service discovery namespace created, you can use `addDefaultCloudMapNamespace` to add a default service discovery namespace later.
5205
+
5206
+ The service discovery namespace created in this cluster.
5207
+
5208
+ ---
5209
+
5210
+ ##### `enableFargateCapacityProviders`<sup>Optional</sup> <a name="enableFargateCapacityProviders" id="cdk-nextjs.OptionalClusterProps.property.enableFargateCapacityProviders"></a>
5211
+
5212
+ ```typescript
5213
+ public readonly enableFargateCapacityProviders: boolean;
5214
+ ```
5215
+
5216
+ - *Type:* boolean
5217
+ - *Default:* false
5218
+
5219
+ Whether to enable Fargate Capacity Providers.
5220
+
5221
+ ---
5222
+
5223
+ ##### `executeCommandConfiguration`<sup>Optional</sup> <a name="executeCommandConfiguration" id="cdk-nextjs.OptionalClusterProps.property.executeCommandConfiguration"></a>
5224
+
5225
+ ```typescript
5226
+ public readonly executeCommandConfiguration: ExecuteCommandConfiguration;
5227
+ ```
5228
+
5229
+ - *Type:* aws-cdk-lib.aws_ecs.ExecuteCommandConfiguration
5230
+ - *Default:* no configuration will be provided.
5231
+
5232
+ The execute command configuration for the cluster.
5233
+
5234
+ ---
5235
+
5236
+ ##### `managedStorageConfiguration`<sup>Optional</sup> <a name="managedStorageConfiguration" id="cdk-nextjs.OptionalClusterProps.property.managedStorageConfiguration"></a>
5237
+
5238
+ ```typescript
5239
+ public readonly managedStorageConfiguration: ManagedStorageConfiguration;
5240
+ ```
5241
+
5242
+ - *Type:* aws-cdk-lib.aws_ecs.ManagedStorageConfiguration
5243
+ - *Default:* no encryption will be applied.
5244
+
5245
+ Encryption configuration for ECS Managed storage.
5246
+
5247
+ ---
5248
+
5249
+ ##### `vpc`<sup>Optional</sup> <a name="vpc" id="cdk-nextjs.OptionalClusterProps.property.vpc"></a>
5250
+
5251
+ ```typescript
5252
+ public readonly vpc: IVpc;
5253
+ ```
5254
+
5255
+ - *Type:* aws-cdk-lib.aws_ec2.IVpc
5256
+ - *Default:* creates a new VPC with two AZs
5257
+
5258
+ The VPC where your ECS instances will be running or your ENIs will be deployed.
5259
+
5260
+ ---
5261
+
5262
+ ### OptionalCustomResourceProps <a name="OptionalCustomResourceProps" id="cdk-nextjs.OptionalCustomResourceProps"></a>
5263
+
5264
+ OptionalCustomResourceProps.
5265
+
5266
+ #### Initializer <a name="Initializer" id="cdk-nextjs.OptionalCustomResourceProps.Initializer"></a>
5267
+
5268
+ ```typescript
5269
+ import { OptionalCustomResourceProps } from 'cdk-nextjs'
5270
+
5271
+ const optionalCustomResourceProps: OptionalCustomResourceProps = { ... }
5272
+ ```
5273
+
5274
+ #### Properties <a name="Properties" id="Properties"></a>
5275
+
5276
+ | **Name** | **Type** | **Description** |
5277
+ | --- | --- | --- |
5278
+ | <code><a href="#cdk-nextjs.OptionalCustomResourceProps.property.pascalCaseProperties">pascalCaseProperties</a></code> | <code>boolean</code> | Convert all property keys to pascal case. |
5279
+ | <code><a href="#cdk-nextjs.OptionalCustomResourceProps.property.properties">properties</a></code> | <code>{[ key: string ]: any}</code> | Properties to pass to the Lambda. |
5280
+ | <code><a href="#cdk-nextjs.OptionalCustomResourceProps.property.removalPolicy">removalPolicy</a></code> | <code>aws-cdk-lib.RemovalPolicy</code> | The policy to apply when this resource is removed from the application. |
5281
+ | <code><a href="#cdk-nextjs.OptionalCustomResourceProps.property.resourceType">resourceType</a></code> | <code>string</code> | For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name. |
5282
+ | <code><a href="#cdk-nextjs.OptionalCustomResourceProps.property.serviceTimeout">serviceTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | The maximum time that can elapse before a custom resource operation times out. |
5283
+ | <code><a href="#cdk-nextjs.OptionalCustomResourceProps.property.serviceToken">serviceToken</a></code> | <code>string</code> | The ARN of the provider which implements this custom resource type. |
5284
+
5285
+ ---
5286
+
5287
+ ##### `pascalCaseProperties`<sup>Optional</sup> <a name="pascalCaseProperties" id="cdk-nextjs.OptionalCustomResourceProps.property.pascalCaseProperties"></a>
5288
+
5289
+ ```typescript
5290
+ public readonly pascalCaseProperties: boolean;
5291
+ ```
5292
+
5293
+ - *Type:* boolean
5294
+ - *Default:* false
5295
+
5296
+ Convert all property keys to pascal case.
5297
+
5298
+ ---
5299
+
5300
+ ##### `properties`<sup>Optional</sup> <a name="properties" id="cdk-nextjs.OptionalCustomResourceProps.property.properties"></a>
5301
+
5302
+ ```typescript
5303
+ public readonly properties: {[ key: string ]: any};
5304
+ ```
5305
+
5306
+ - *Type:* {[ key: string ]: any}
5307
+ - *Default:* No properties.
5145
5308
 
5146
- The CloudWatch Container Insights configuration for the cluster.
5309
+ Properties to pass to the Lambda.
5310
+
5311
+ Values in this `properties` dictionary can possibly overwrite other values in `CustomResourceProps`
5312
+ E.g. `ServiceToken` and `ServiceTimeout`
5313
+ It is recommended to avoid using same keys that exist in `CustomResourceProps`
5147
5314
 
5148
5315
  ---
5149
5316
 
5150
- ##### `defaultCloudMapNamespace`<sup>Optional</sup> <a name="defaultCloudMapNamespace" id="cdk-nextjs.OptionalClusterProps.property.defaultCloudMapNamespace"></a>
5317
+ ##### `removalPolicy`<sup>Optional</sup> <a name="removalPolicy" id="cdk-nextjs.OptionalCustomResourceProps.property.removalPolicy"></a>
5151
5318
 
5152
5319
  ```typescript
5153
- public readonly defaultCloudMapNamespace: CloudMapNamespaceOptions;
5320
+ public readonly removalPolicy: RemovalPolicy;
5154
5321
  ```
5155
5322
 
5156
- - *Type:* aws-cdk-lib.aws_ecs.CloudMapNamespaceOptions
5157
- - *Default:* no service discovery namespace created, you can use `addDefaultCloudMapNamespace` to add a default service discovery namespace later.
5323
+ - *Type:* aws-cdk-lib.RemovalPolicy
5324
+ - *Default:* cdk.RemovalPolicy.Destroy
5158
5325
 
5159
- The service discovery namespace created in this cluster.
5326
+ The policy to apply when this resource is removed from the application.
5160
5327
 
5161
5328
  ---
5162
5329
 
5163
- ##### `enableFargateCapacityProviders`<sup>Optional</sup> <a name="enableFargateCapacityProviders" id="cdk-nextjs.OptionalClusterProps.property.enableFargateCapacityProviders"></a>
5330
+ ##### `resourceType`<sup>Optional</sup> <a name="resourceType" id="cdk-nextjs.OptionalCustomResourceProps.property.resourceType"></a>
5164
5331
 
5165
5332
  ```typescript
5166
- public readonly enableFargateCapacityProviders: boolean;
5333
+ public readonly resourceType: string;
5167
5334
  ```
5168
5335
 
5169
- - *Type:* boolean
5170
- - *Default:* false
5336
+ - *Type:* string
5337
+ - *Default:* AWS::CloudFormation::CustomResource
5171
5338
 
5172
- Whether to enable Fargate Capacity Providers.
5339
+ For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name.
5340
+
5341
+ For example, you can use "Custom::MyCustomResourceTypeName".
5342
+
5343
+ Custom resource type names must begin with "Custom::" and can include
5344
+ alphanumeric characters and the following characters: _@-. You can specify
5345
+ a custom resource type name up to a maximum length of 60 characters. You
5346
+ cannot change the type during an update.
5347
+
5348
+ Using your own resource type names helps you quickly differentiate the
5349
+ types of custom resources in your stack. For example, if you had two custom
5350
+ resources that conduct two different ping tests, you could name their type
5351
+ as Custom::PingTester to make them easily identifiable as ping testers
5352
+ (instead of using AWS::CloudFormation::CustomResource).
5173
5353
 
5174
5354
  ---
5175
5355
 
5176
- ##### `executeCommandConfiguration`<sup>Optional</sup> <a name="executeCommandConfiguration" id="cdk-nextjs.OptionalClusterProps.property.executeCommandConfiguration"></a>
5356
+ ##### `serviceTimeout`<sup>Optional</sup> <a name="serviceTimeout" id="cdk-nextjs.OptionalCustomResourceProps.property.serviceTimeout"></a>
5177
5357
 
5178
5358
  ```typescript
5179
- public readonly executeCommandConfiguration: ExecuteCommandConfiguration;
5359
+ public readonly serviceTimeout: Duration;
5180
5360
  ```
5181
5361
 
5182
- - *Type:* aws-cdk-lib.aws_ecs.ExecuteCommandConfiguration
5183
- - *Default:* no configuration will be provided.
5362
+ - *Type:* aws-cdk-lib.Duration
5363
+ - *Default:* Duration.seconds(3600)
5184
5364
 
5185
- The execute command configuration for the cluster.
5365
+ The maximum time that can elapse before a custom resource operation times out.
5366
+
5367
+ The value must be between 1 second and 3600 seconds.
5368
+
5369
+ Maps to [ServiceTimeout](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-customresource.html#cfn-cloudformation-customresource-servicetimeout) property for the `AWS::CloudFormation::CustomResource` resource
5370
+
5371
+ A token can be specified for this property, but it must be specified with `Duration.seconds()`.
5186
5372
 
5187
5373
  ---
5188
5374
 
5189
- ##### `managedStorageConfiguration`<sup>Optional</sup> <a name="managedStorageConfiguration" id="cdk-nextjs.OptionalClusterProps.property.managedStorageConfiguration"></a>
5375
+ ##### `serviceToken`<sup>Optional</sup> <a name="serviceToken" id="cdk-nextjs.OptionalCustomResourceProps.property.serviceToken"></a>
5190
5376
 
5191
5377
  ```typescript
5192
- public readonly managedStorageConfiguration: ManagedStorageConfiguration;
5378
+ public readonly serviceToken: string;
5193
5379
  ```
5194
5380
 
5195
- - *Type:* aws-cdk-lib.aws_ecs.ManagedStorageConfiguration
5196
- - *Default:* no encryption will be applied.
5381
+ - *Type:* string
5197
5382
 
5198
- Encryption configuration for ECS Managed storage.
5383
+ The ARN of the provider which implements this custom resource type.
5199
5384
 
5200
- ---
5385
+ You can implement a provider by listening to raw AWS CloudFormation events
5386
+ and specify the ARN of an SNS topic (`topic.topicArn`) or the ARN of an AWS
5387
+ Lambda function (`lambda.functionArn`) or use the CDK's custom [resource
5388
+ provider framework] which makes it easier to implement robust providers.
5201
5389
 
5202
- ##### `vpc`<sup>Optional</sup> <a name="vpc" id="cdk-nextjs.OptionalClusterProps.property.vpc"></a>
5390
+ [resource provider framework]:
5391
+ https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html
5203
5392
 
5204
- ```typescript
5205
- public readonly vpc: IVpc;
5393
+ Provider framework:
5394
+
5395
+ ```ts
5396
+ // use the provider framework from aws-cdk/custom-resources:
5397
+ const provider = new customresources.Provider(this, 'ResourceProvider', {
5398
+ onEventHandler,
5399
+ isCompleteHandler, // optional
5400
+ });
5401
+
5402
+ new CustomResource(this, 'MyResource', {
5403
+ serviceToken: provider.serviceToken,
5404
+ });
5206
5405
  ```
5207
5406
 
5208
- - *Type:* aws-cdk-lib.aws_ec2.IVpc
5209
- - *Default:* creates a new VPC with two AZs
5407
+ AWS Lambda function (not recommended to use AWS Lambda Functions directly,
5408
+ see the module README):
5210
5409
 
5211
- The VPC where your ECS instances will be running or your ENIs will be deployed.
5410
+ ```ts
5411
+ // invoke an AWS Lambda function when a lifecycle event occurs:
5412
+ new CustomResource(this, 'MyResource', {
5413
+ serviceToken: myFunction.functionArn,
5414
+ });
5415
+ ```
5416
+
5417
+ SNS topic (not recommended to use AWS Lambda Functions directly, see the
5418
+ module README):
5419
+
5420
+ ```ts
5421
+ // publish lifecycle events to an SNS topic:
5422
+ new CustomResource(this, 'MyResource', {
5423
+ serviceToken: myTopic.topicArn,
5424
+ });
5425
+ ```
5426
+
5427
+ Maps to [ServiceToken](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-customresource.html#cfn-cloudformation-customresource-servicetoken) property for the `AWS::CloudFormation::CustomResource` resource
5212
5428
 
5213
5429
  ---
5214
5430
 
@@ -5573,6 +5789,7 @@ const optionalDockerImageAssetProps: OptionalDockerImageAssetProps = { ... }
5573
5789
  | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps.property.cacheFrom">cacheFrom</a></code> | <code>aws-cdk-lib.aws_ecr_assets.DockerCacheOption[]</code> | Cache from options to pass to the `docker build` command. |
5574
5790
  | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps.property.cacheTo">cacheTo</a></code> | <code>aws-cdk-lib.aws_ecr_assets.DockerCacheOption</code> | Cache to options to pass to the `docker build` command. |
5575
5791
  | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps.property.directory">directory</a></code> | <code>string</code> | The directory where the Dockerfile is stored. |
5792
+ | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps.property.displayName">displayName</a></code> | <code>string</code> | A display name for this asset. |
5576
5793
  | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps.property.exclude">exclude</a></code> | <code>string[]</code> | File paths matching the patterns will be excluded. |
5577
5794
  | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps.property.extraHash">extraHash</a></code> | <code>string</code> | Extra information to encode into the fingerprint (e.g. build instructions and other inputs). |
5578
5795
  | <code><a href="#cdk-nextjs.OptionalDockerImageAssetProps.property.file">file</a></code> | <code>string</code> | Path to the Dockerfile (relative to the directory). |
@@ -5701,6 +5918,35 @@ Any directory inside with a name that matches the CDK output folder (cdk.out by
5701
5918
 
5702
5919
  ---
5703
5920
 
5921
+ ##### `displayName`<sup>Optional</sup> <a name="displayName" id="cdk-nextjs.OptionalDockerImageAssetProps.property.displayName"></a>
5922
+
5923
+ ```typescript
5924
+ public readonly displayName: string;
5925
+ ```
5926
+
5927
+ - *Type:* string
5928
+ - *Default:* Stack-relative construct path
5929
+
5930
+ A display name for this asset.
5931
+
5932
+ If supplied, the display name will be used in locations where the asset
5933
+ identifier is printed, like in the CLI progress information. If the same
5934
+ asset is added multiple times, the display name of the first occurrence is
5935
+ used.
5936
+
5937
+ If `assetName` is given, it will also be used as the default `displayName`.
5938
+ Otherwise, the default is the construct path of the ImageAsset construct,
5939
+ with respect to the enclosing stack. If the asset is produced by a
5940
+ construct helper function (such as `lambda.Code.fromAssetImage()`), this
5941
+ will look like `MyFunction/AssetImage`.
5942
+
5943
+ We use the stack-relative construct path so that in the common case where
5944
+ you have multiple stacks with the same asset, we won't show something like
5945
+ `/MyBetaStack/MyFunction/Code` when you are actually deploying to
5946
+ production.
5947
+
5948
+ ---
5949
+
5704
5950
  ##### `exclude`<sup>Optional</sup> <a name="exclude" id="cdk-nextjs.OptionalDockerImageAssetProps.property.exclude"></a>
5705
5951
 
5706
5952
  ```typescript
@@ -8539,12 +8785,12 @@ const optionalNextjsAssetsDeploymentProps: OptionalNextjsAssetsDeploymentProps =
8539
8785
  | --- | --- | --- |
8540
8786
  | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
8541
8787
  | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.basePath">basePath</a></code> | <code>string</code> | Prefix to the URI path the app will be served at. |
8788
+ | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.buildId">buildId</a></code> | <code>string</code> | *No description.* |
8542
8789
  | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.buildImageDigest">buildImageDigest</a></code> | <code>string</code> | *No description.* |
8543
- | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.containerMountPathForEfs">containerMountPathForEfs</a></code> | <code>string</code> | *No description.* |
8544
- | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.debug">debug</a></code> | <code>boolean</code> | *No description.* |
8790
+ | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.debug">debug</a></code> | <code>boolean</code> | If true, logs details in custom resource lambda. |
8545
8791
  | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.dockerImageCode">dockerImageCode</a></code> | <code>aws-cdk-lib.aws_lambda.DockerImageCode</code> | *No description.* |
8546
8792
  | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.nextjsType">nextjsType</a></code> | <code><a href="#cdk-nextjs.NextjsType">NextjsType</a></code> | *No description.* |
8547
- | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
8793
+ | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | *No description.* |
8548
8794
  | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.Bucket</code> | Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`. |
8549
8795
  | <code><a href="#cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
8550
8796
 
@@ -8572,20 +8818,20 @@ Prefix to the URI path the app will be served at.
8572
8818
 
8573
8819
  ---
8574
8820
 
8575
- ##### `buildImageDigest`<sup>Optional</sup> <a name="buildImageDigest" id="cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.buildImageDigest"></a>
8821
+ ##### `buildId`<sup>Optional</sup> <a name="buildId" id="cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.buildId"></a>
8576
8822
 
8577
8823
  ```typescript
8578
- public readonly buildImageDigest: string;
8824
+ public readonly buildId: string;
8579
8825
  ```
8580
8826
 
8581
8827
  - *Type:* string
8582
8828
 
8583
8829
  ---
8584
8830
 
8585
- ##### `containerMountPathForEfs`<sup>Optional</sup> <a name="containerMountPathForEfs" id="cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.containerMountPathForEfs"></a>
8831
+ ##### `buildImageDigest`<sup>Optional</sup> <a name="buildImageDigest" id="cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.buildImageDigest"></a>
8586
8832
 
8587
8833
  ```typescript
8588
- public readonly containerMountPathForEfs: string;
8834
+ public readonly buildImageDigest: string;
8589
8835
  ```
8590
8836
 
8591
8837
  - *Type:* string
@@ -8601,6 +8847,8 @@ public readonly debug: boolean;
8601
8847
  - *Type:* boolean
8602
8848
  - *Default:* true
8603
8849
 
8850
+ If true, logs details in custom resource lambda.
8851
+
8604
8852
  ---
8605
8853
 
8606
8854
  ##### `dockerImageCode`<sup>Optional</sup> <a name="dockerImageCode" id="cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.dockerImageCode"></a>
@@ -8623,10 +8871,10 @@ public readonly nextjsType: NextjsType;
8623
8871
 
8624
8872
  ---
8625
8873
 
8626
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.relativePathToWorkspace"></a>
8874
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.OptionalNextjsAssetsDeploymentProps.property.relativePathToPackage"></a>
8627
8875
 
8628
8876
  ```typescript
8629
- public readonly relativePathToWorkspace: string;
8877
+ public readonly relativePathToPackage: string;
8630
8878
  ```
8631
8879
 
8632
8880
  - *Type:* string
@@ -8675,7 +8923,7 @@ const optionalNextjsBuildProps: OptionalNextjsBuildProps = { ... }
8675
8923
  | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps.property.buildContext">buildContext</a></code> | <code>string</code> | *No description.* |
8676
8924
  | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps.property.builderImageProps">builderImageProps</a></code> | <code><a href="#cdk-nextjs.BuilderImageProps">BuilderImageProps</a></code> | *No description.* |
8677
8925
  | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps.property.nextjsType">nextjsType</a></code> | <code><a href="#cdk-nextjs.NextjsType">NextjsType</a></code> | *No description.* |
8678
- | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps.property.relativePathToWorkspace">relativePathToWorkspace</a></code> | <code>string</code> | *No description.* |
8926
+ | <code><a href="#cdk-nextjs.OptionalNextjsBuildProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | *No description.* |
8679
8927
 
8680
8928
  ---
8681
8929
 
@@ -8719,10 +8967,10 @@ public readonly nextjsType: NextjsType;
8719
8967
 
8720
8968
  ---
8721
8969
 
8722
- ##### `relativePathToWorkspace`<sup>Optional</sup> <a name="relativePathToWorkspace" id="cdk-nextjs.OptionalNextjsBuildProps.property.relativePathToWorkspace"></a>
8970
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.OptionalNextjsBuildProps.property.relativePathToPackage"></a>
8723
8971
 
8724
8972
  ```typescript
8725
- public readonly relativePathToWorkspace: string;
8973
+ public readonly relativePathToPackage: string;
8726
8974
  ```
8727
8975
 
8728
8976
  - *Type:* string
@@ -8746,7 +8994,7 @@ const optionalNextjsContainersProps: OptionalNextjsContainersProps = { ... }
8746
8994
  | **Name** | **Type** | **Description** |
8747
8995
  | --- | --- | --- |
8748
8996
  | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
8749
- | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps.property.containerMountPathForEfs">containerMountPathForEfs</a></code> | <code>string</code> | *No description.* |
8997
+ | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps.property.buildId">buildId</a></code> | <code>string</code> | *No description.* |
8750
8998
  | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps.property.dockerImageAsset">dockerImageAsset</a></code> | <code>aws-cdk-lib.aws_ecr_assets.DockerImageAsset</code> | *No description.* |
8751
8999
  | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps.property.fileSystem">fileSystem</a></code> | <code>aws-cdk-lib.aws_efs.FileSystem</code> | *No description.* |
8752
9000
  | <code><a href="#cdk-nextjs.OptionalNextjsContainersProps.property.healthCheckPath">healthCheckPath</a></code> | <code>string</code> | *No description.* |
@@ -8766,10 +9014,10 @@ public readonly accessPoint: AccessPoint;
8766
9014
 
8767
9015
  ---
8768
9016
 
8769
- ##### `containerMountPathForEfs`<sup>Optional</sup> <a name="containerMountPathForEfs" id="cdk-nextjs.OptionalNextjsContainersProps.property.containerMountPathForEfs"></a>
9017
+ ##### `buildId`<sup>Optional</sup> <a name="buildId" id="cdk-nextjs.OptionalNextjsContainersProps.property.buildId"></a>
8770
9018
 
8771
9019
  ```typescript
8772
- public readonly containerMountPathForEfs: string;
9020
+ public readonly buildId: string;
8773
9021
  ```
8774
9022
 
8775
9023
  - *Type:* string
@@ -8985,27 +9233,77 @@ public readonly vpc: IVpc;
8985
9233
 
8986
9234
  ---
8987
9235
 
8988
- ### OptionalNextjsInvalidationProps <a name="OptionalNextjsInvalidationProps" id="cdk-nextjs.OptionalNextjsInvalidationProps"></a>
9236
+ ### OptionalNextjsPostDeployProps <a name="OptionalNextjsPostDeployProps" id="cdk-nextjs.OptionalNextjsPostDeployProps"></a>
8989
9237
 
8990
- OptionalNextjsInvalidationProps.
9238
+ OptionalNextjsPostDeployProps.
8991
9239
 
8992
- #### Initializer <a name="Initializer" id="cdk-nextjs.OptionalNextjsInvalidationProps.Initializer"></a>
9240
+ #### Initializer <a name="Initializer" id="cdk-nextjs.OptionalNextjsPostDeployProps.Initializer"></a>
8993
9241
 
8994
9242
  ```typescript
8995
- import { OptionalNextjsInvalidationProps } from 'cdk-nextjs'
9243
+ import { OptionalNextjsPostDeployProps } from 'cdk-nextjs'
8996
9244
 
8997
- const optionalNextjsInvalidationProps: OptionalNextjsInvalidationProps = { ... }
9245
+ const optionalNextjsPostDeployProps: OptionalNextjsPostDeployProps = { ... }
8998
9246
  ```
8999
9247
 
9000
9248
  #### Properties <a name="Properties" id="Properties"></a>
9001
9249
 
9002
9250
  | **Name** | **Type** | **Description** |
9003
9251
  | --- | --- | --- |
9004
- | <code><a href="#cdk-nextjs.OptionalNextjsInvalidationProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.IDistribution</code> | CloudFront Distribution to invalidate. |
9252
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.accessPoint">accessPoint</a></code> | <code>aws-cdk-lib.aws_efs.AccessPoint</code> | *No description.* |
9253
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.buildId">buildId</a></code> | <code>string</code> | *No description.* |
9254
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.buildImageDigest">buildImageDigest</a></code> | <code>string</code> | *No description.* |
9255
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.debug">debug</a></code> | <code>boolean</code> | If true, logs details in custom resource lambda. |
9256
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.IDistribution</code> | CloudFront Distribution to invalidate. |
9257
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.relativePathToPackage">relativePathToPackage</a></code> | <code>string</code> | *No description.* |
9258
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.Bucket</code> | Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`. |
9259
+ | <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
9260
+
9261
+ ---
9262
+
9263
+ ##### `accessPoint`<sup>Optional</sup> <a name="accessPoint" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.accessPoint"></a>
9264
+
9265
+ ```typescript
9266
+ public readonly accessPoint: AccessPoint;
9267
+ ```
9268
+
9269
+ - *Type:* aws-cdk-lib.aws_efs.AccessPoint
9270
+
9271
+ ---
9272
+
9273
+ ##### `buildId`<sup>Optional</sup> <a name="buildId" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.buildId"></a>
9274
+
9275
+ ```typescript
9276
+ public readonly buildId: string;
9277
+ ```
9278
+
9279
+ - *Type:* string
9280
+
9281
+ ---
9282
+
9283
+ ##### `buildImageDigest`<sup>Optional</sup> <a name="buildImageDigest" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.buildImageDigest"></a>
9284
+
9285
+ ```typescript
9286
+ public readonly buildImageDigest: string;
9287
+ ```
9288
+
9289
+ - *Type:* string
9290
+
9291
+ ---
9292
+
9293
+ ##### `debug`<sup>Optional</sup> <a name="debug" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.debug"></a>
9294
+
9295
+ ```typescript
9296
+ public readonly debug: boolean;
9297
+ ```
9298
+
9299
+ - *Type:* boolean
9300
+ - *Default:* true
9301
+
9302
+ If true, logs details in custom resource lambda.
9005
9303
 
9006
9304
  ---
9007
9305
 
9008
- ##### `distribution`<sup>Optional</sup> <a name="distribution" id="cdk-nextjs.OptionalNextjsInvalidationProps.property.distribution"></a>
9306
+ ##### `distribution`<sup>Optional</sup> <a name="distribution" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.distribution"></a>
9009
9307
 
9010
9308
  ```typescript
9011
9309
  public readonly distribution: IDistribution;
@@ -9017,6 +9315,38 @@ CloudFront Distribution to invalidate.
9017
9315
 
9018
9316
  ---
9019
9317
 
9318
+ ##### `relativePathToPackage`<sup>Optional</sup> <a name="relativePathToPackage" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.relativePathToPackage"></a>
9319
+
9320
+ ```typescript
9321
+ public readonly relativePathToPackage: string;
9322
+ ```
9323
+
9324
+ - *Type:* string
9325
+
9326
+ ---
9327
+
9328
+ ##### `staticAssetsBucket`<sup>Optional</sup> <a name="staticAssetsBucket" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.staticAssetsBucket"></a>
9329
+
9330
+ ```typescript
9331
+ public readonly staticAssetsBucket: Bucket;
9332
+ ```
9333
+
9334
+ - *Type:* aws-cdk-lib.aws_s3.Bucket
9335
+
9336
+ Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`.
9337
+
9338
+ ---
9339
+
9340
+ ##### `vpc`<sup>Optional</sup> <a name="vpc" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.vpc"></a>
9341
+
9342
+ ```typescript
9343
+ public readonly vpc: IVpc;
9344
+ ```
9345
+
9346
+ - *Type:* aws-cdk-lib.aws_ec2.IVpc
9347
+
9348
+ ---
9349
+
9020
9350
  ### OptionalNextjsVpcProps <a name="OptionalNextjsVpcProps" id="cdk-nextjs.OptionalNextjsVpcProps"></a>
9021
9351
 
9022
9352
  OptionalNextjsVpcProps.
@@ -9060,6 +9390,91 @@ Bring your own VPC.
9060
9390
 
9061
9391
  ---
9062
9392
 
9393
+ ### OptionalPostDeployCustomResourceProperties <a name="OptionalPostDeployCustomResourceProperties" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties"></a>
9394
+
9395
+ OptionalPostDeployCustomResourceProperties.
9396
+
9397
+ #### Initializer <a name="Initializer" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties.Initializer"></a>
9398
+
9399
+ ```typescript
9400
+ import { OptionalPostDeployCustomResourceProperties } from 'cdk-nextjs'
9401
+
9402
+ const optionalPostDeployCustomResourceProperties: OptionalPostDeployCustomResourceProperties = { ... }
9403
+ ```
9404
+
9405
+ #### Properties <a name="Properties" id="Properties"></a>
9406
+
9407
+ | **Name** | **Type** | **Description** |
9408
+ | --- | --- | --- |
9409
+ | <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.buildId">buildId</a></code> | <code>string</code> | Build ID of current deployment. |
9410
+ | <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.buildImageDigest">buildImageDigest</a></code> | <code>string</code> | *No description.* |
9411
+ | <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.createInvalidationCommandInput">createInvalidationCommandInput</a></code> | <code>{[ key: string ]: any}</code> | *No description.* |
9412
+ | <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.msTtl">msTtl</a></code> | <code>string</code> | Time to live in milliseconds. |
9413
+ | <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.staticAssetsBucketName">staticAssetsBucketName</a></code> | <code>string</code> | *No description.* |
9414
+
9415
+ ---
9416
+
9417
+ ##### `buildId`<sup>Optional</sup> <a name="buildId" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.buildId"></a>
9418
+
9419
+ ```typescript
9420
+ public readonly buildId: string;
9421
+ ```
9422
+
9423
+ - *Type:* string
9424
+
9425
+ Build ID of current deployment.
9426
+
9427
+ Used to prune FileSystem of directories
9428
+ with old build ids and prune S3 based on metadat and `msTtl`
9429
+
9430
+ ---
9431
+
9432
+ ##### `buildImageDigest`<sup>Optional</sup> <a name="buildImageDigest" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.buildImageDigest"></a>
9433
+
9434
+ ```typescript
9435
+ public readonly buildImageDigest: string;
9436
+ ```
9437
+
9438
+ - *Type:* string
9439
+
9440
+ ---
9441
+
9442
+ ##### `createInvalidationCommandInput`<sup>Optional</sup> <a name="createInvalidationCommandInput" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.createInvalidationCommandInput"></a>
9443
+
9444
+ ```typescript
9445
+ public readonly createInvalidationCommandInput: {[ key: string ]: any};
9446
+ ```
9447
+
9448
+ - *Type:* {[ key: string ]: any}
9449
+ - *Default:* { distributionId: this.props.distribution?.distributionId, invalidationBatch: { callerReference: new Date().toISOString(), paths: { quantity: 1, items: ["/*"], // invalidate all paths }, }, }
9450
+
9451
+ ---
9452
+
9453
+ ##### `msTtl`<sup>Optional</sup> <a name="msTtl" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.msTtl"></a>
9454
+
9455
+ ```typescript
9456
+ public readonly msTtl: string;
9457
+ ```
9458
+
9459
+ - *Type:* string
9460
+ - *Default:* (1000 * 60 * 60 * 24 * 30).toString()
9461
+
9462
+ Time to live in milliseconds.
9463
+
9464
+ Must be string because of CloudFormation Custom Resource limitation
9465
+
9466
+ ---
9467
+
9468
+ ##### `staticAssetsBucketName`<sup>Optional</sup> <a name="staticAssetsBucketName" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.staticAssetsBucketName"></a>
9469
+
9470
+ ```typescript
9471
+ public readonly staticAssetsBucketName: string;
9472
+ ```
9473
+
9474
+ - *Type:* string
9475
+
9476
+ ---
9477
+
9063
9478
  ### OptionalS3OriginBucketWithOACProps <a name="OptionalS3OriginBucketWithOACProps" id="cdk-nextjs.OptionalS3OriginBucketWithOACProps"></a>
9064
9479
 
9065
9480
  OptionalS3OriginBucketWithOACProps.
@@ -9651,6 +10066,93 @@ Where to propagate VPN routes.
9651
10066
 
9652
10067
  ---
9653
10068
 
10069
+ ### PostDeployCustomResourceProperties <a name="PostDeployCustomResourceProperties" id="cdk-nextjs.PostDeployCustomResourceProperties"></a>
10070
+
10071
+ #### Initializer <a name="Initializer" id="cdk-nextjs.PostDeployCustomResourceProperties.Initializer"></a>
10072
+
10073
+ ```typescript
10074
+ import { PostDeployCustomResourceProperties } from 'cdk-nextjs'
10075
+
10076
+ const postDeployCustomResourceProperties: PostDeployCustomResourceProperties = { ... }
10077
+ ```
10078
+
10079
+ #### Properties <a name="Properties" id="Properties"></a>
10080
+
10081
+ | **Name** | **Type** | **Description** |
10082
+ | --- | --- | --- |
10083
+ | <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.buildId">buildId</a></code> | <code>string</code> | Build ID of current deployment. |
10084
+ | <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.buildImageDigest">buildImageDigest</a></code> | <code>string</code> | *No description.* |
10085
+ | <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.msTtl">msTtl</a></code> | <code>string</code> | Time to live in milliseconds. |
10086
+ | <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.createInvalidationCommandInput">createInvalidationCommandInput</a></code> | <code>{[ key: string ]: any}</code> | *No description.* |
10087
+ | <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.staticAssetsBucketName">staticAssetsBucketName</a></code> | <code>string</code> | *No description.* |
10088
+
10089
+ ---
10090
+
10091
+ ##### `buildId`<sup>Required</sup> <a name="buildId" id="cdk-nextjs.PostDeployCustomResourceProperties.property.buildId"></a>
10092
+
10093
+ ```typescript
10094
+ public readonly buildId: string;
10095
+ ```
10096
+
10097
+ - *Type:* string
10098
+
10099
+ Build ID of current deployment.
10100
+
10101
+ Used to prune FileSystem of directories
10102
+ with old build ids and prune S3 based on metadat and `msTtl`
10103
+
10104
+ ---
10105
+
10106
+ ##### `buildImageDigest`<sup>Required</sup> <a name="buildImageDigest" id="cdk-nextjs.PostDeployCustomResourceProperties.property.buildImageDigest"></a>
10107
+
10108
+ ```typescript
10109
+ public readonly buildImageDigest: string;
10110
+ ```
10111
+
10112
+ - *Type:* string
10113
+
10114
+ > [{@link NextjsBuild.buildImageDigest }]({@link NextjsBuild.buildImageDigest })
10115
+
10116
+ ---
10117
+
10118
+ ##### `msTtl`<sup>Required</sup> <a name="msTtl" id="cdk-nextjs.PostDeployCustomResourceProperties.property.msTtl"></a>
10119
+
10120
+ ```typescript
10121
+ public readonly msTtl: string;
10122
+ ```
10123
+
10124
+ - *Type:* string
10125
+ - *Default:* (1000 * 60 * 60 * 24 * 30).toString()
10126
+
10127
+ Time to live in milliseconds.
10128
+
10129
+ Must be string because of CloudFormation Custom Resource limitation
10130
+
10131
+ ---
10132
+
10133
+ ##### `createInvalidationCommandInput`<sup>Optional</sup> <a name="createInvalidationCommandInput" id="cdk-nextjs.PostDeployCustomResourceProperties.property.createInvalidationCommandInput"></a>
10134
+
10135
+ ```typescript
10136
+ public readonly createInvalidationCommandInput: {[ key: string ]: any};
10137
+ ```
10138
+
10139
+ - *Type:* {[ key: string ]: any}
10140
+ - *Default:* { distributionId: this.props.distribution?.distributionId, invalidationBatch: { callerReference: new Date().toISOString(), paths: { quantity: 1, items: ["/*"], // invalidate all paths }, }, }
10141
+
10142
+ > [https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudfront/command/CreateInvalidationCommand/](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudfront/command/CreateInvalidationCommand/)
10143
+
10144
+ ---
10145
+
10146
+ ##### `staticAssetsBucketName`<sup>Optional</sup> <a name="staticAssetsBucketName" id="cdk-nextjs.PostDeployCustomResourceProperties.property.staticAssetsBucketName"></a>
10147
+
10148
+ ```typescript
10149
+ public readonly staticAssetsBucketName: string;
10150
+ ```
10151
+
10152
+ - *Type:* string
10153
+
10154
+ ---
10155
+
9654
10156
  ### PublicDirEntry <a name="PublicDirEntry" id="cdk-nextjs.PublicDirEntry"></a>
9655
10157
 
9656
10158
  #### Initializer <a name="Initializer" id="cdk-nextjs.PublicDirEntry.Initializer"></a>