sst 2.36.1 → 2.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bootstrap.js +1 -1
- package/constructs/App.d.ts +1 -1
- package/constructs/App.js +7 -4
- package/constructs/AstroSite.d.ts +1 -1
- package/constructs/EdgeFunction.d.ts +1 -1
- package/constructs/EdgeFunction.js +7 -10
- package/constructs/EventBus.js +1 -1
- package/constructs/Function.d.ts +5 -8
- package/constructs/Function.js +10 -6
- package/constructs/Job.js +1 -1
- package/constructs/NextjsSite.d.ts +6 -25
- package/constructs/NextjsSite.js +1 -2
- package/constructs/RDS.d.ts +1 -1
- package/constructs/RDS.js +2 -2
- package/constructs/RemixSite.d.ts +1 -1
- package/constructs/Script.js +1 -1
- package/constructs/SolidStartSite.d.ts +1 -1
- package/constructs/SsrFunction.d.ts +2 -2
- package/constructs/SsrFunction.js +2 -7
- package/constructs/SsrSite.d.ts +2 -2
- package/constructs/SsrSite.js +2 -2
- package/constructs/Stack.js +1 -1
- package/constructs/SvelteKitSite.d.ts +1 -1
- package/constructs/WebSocketApi.d.ts +5 -1
- package/constructs/WebSocketApi.js +3 -0
- package/constructs/cdk/dns-validated-certificate.js +1 -1
- package/constructs/deprecated/NextjsSite.d.ts +1 -1
- package/constructs/deprecated/NextjsSite.js +1 -4
- package/constructs/deprecated/cross-region-helper.js +3 -3
- package/node/event-bus/index.d.ts +1 -1
- package/package.json +2 -2
package/bootstrap.js
CHANGED
|
@@ -203,7 +203,7 @@ export async function bootstrapSST(cdkBucket) {
|
|
|
203
203
|
code: Code.fromAsset(path.resolve(__dirname, "support/bootstrap-metadata-function")),
|
|
204
204
|
handler: "index.handler",
|
|
205
205
|
runtime: region?.startsWith("us-gov-")
|
|
206
|
-
? Runtime.
|
|
206
|
+
? Runtime.NODEJS_18_X
|
|
207
207
|
: Runtime.NODEJS_18_X,
|
|
208
208
|
environment: {
|
|
209
209
|
BUCKET_NAME: bucket.bucketName,
|
package/constructs/App.d.ts
CHANGED
package/constructs/App.js
CHANGED
|
@@ -117,7 +117,7 @@ export class App extends CDKApp {
|
|
|
117
117
|
* @example
|
|
118
118
|
* ```js
|
|
119
119
|
* app.setDefaultFunctionProps({
|
|
120
|
-
* runtime: "
|
|
120
|
+
* runtime: "nodejs18.x",
|
|
121
121
|
* timeout: 30
|
|
122
122
|
* })
|
|
123
123
|
* ```
|
|
@@ -273,7 +273,7 @@ export class App extends CDKApp {
|
|
|
273
273
|
effect: Effect.ALLOW,
|
|
274
274
|
actions: ["s3:GetObject", "s3:PutObject"],
|
|
275
275
|
resources: [
|
|
276
|
-
sourcemaps[0].
|
|
276
|
+
sourcemaps[0].asset.bucket.bucketArn + "/*",
|
|
277
277
|
`arn:${child.partition}:s3:::${bootstrap.bucket}/*`,
|
|
278
278
|
],
|
|
279
279
|
}),
|
|
@@ -287,8 +287,11 @@ export class App extends CDKApp {
|
|
|
287
287
|
app: this.name,
|
|
288
288
|
stage: this.stage,
|
|
289
289
|
tarBucket: bootstrap.bucket,
|
|
290
|
-
srcBucket: sourcemaps[0].
|
|
291
|
-
sourcemaps: sourcemaps.map((s) => [
|
|
290
|
+
srcBucket: sourcemaps[0].asset.bucket.bucketName,
|
|
291
|
+
sourcemaps: sourcemaps.map((s) => [
|
|
292
|
+
s.tarKey,
|
|
293
|
+
s.asset.s3ObjectKey,
|
|
294
|
+
]),
|
|
292
295
|
},
|
|
293
296
|
});
|
|
294
297
|
resource.node.addDependency(policy);
|
|
@@ -70,7 +70,7 @@ export declare class AstroSite extends SsrSite {
|
|
|
70
70
|
data: {
|
|
71
71
|
mode: "placeholder" | "deployed";
|
|
72
72
|
path: string;
|
|
73
|
-
runtime: "
|
|
73
|
+
runtime: "nodejs16.x" | "nodejs18.x";
|
|
74
74
|
customDomainUrl: string | undefined;
|
|
75
75
|
url: string | undefined;
|
|
76
76
|
edge: boolean | undefined;
|
|
@@ -9,7 +9,7 @@ import { Permissions } from "./util/permission.js";
|
|
|
9
9
|
export interface EdgeFunctionProps {
|
|
10
10
|
bundle?: string;
|
|
11
11
|
handler: string;
|
|
12
|
-
runtime?: "
|
|
12
|
+
runtime?: "nodejs16.x" | "nodejs18.x";
|
|
13
13
|
timeout?: number | Duration;
|
|
14
14
|
memorySize?: number | Size;
|
|
15
15
|
permissions?: Permissions;
|
|
@@ -125,8 +125,7 @@ export class EdgeFunction extends Construct {
|
|
|
125
125
|
});
|
|
126
126
|
await fs.promises.rm(result.sourcemap);
|
|
127
127
|
useFunctions().sourcemaps.add(stack.stackName, {
|
|
128
|
-
|
|
129
|
-
srcKey: asset.s3ObjectKey,
|
|
128
|
+
asset,
|
|
130
129
|
tarKey: this.functionArn,
|
|
131
130
|
});
|
|
132
131
|
}
|
|
@@ -285,7 +284,7 @@ export class EdgeFunction extends Construct {
|
|
|
285
284
|
const provider = new CdkFunction(stack, providerId, {
|
|
286
285
|
code: Code.fromAsset(path.join(__dirname, "../support/edge-function")),
|
|
287
286
|
handler: "s3-bucket.handler",
|
|
288
|
-
runtime: Runtime.
|
|
287
|
+
runtime: Runtime.NODEJS_18_X,
|
|
289
288
|
timeout: CdkDuration.minutes(15),
|
|
290
289
|
memorySize: 1024,
|
|
291
290
|
initialPolicy: [
|
|
@@ -318,7 +317,7 @@ export class EdgeFunction extends Construct {
|
|
|
318
317
|
provider = new CdkFunction(stack, providerId, {
|
|
319
318
|
code: Code.fromAsset(path.join(__dirname, "../support/edge-function")),
|
|
320
319
|
handler: "edge-lambda.handler",
|
|
321
|
-
runtime: Runtime.
|
|
320
|
+
runtime: Runtime.NODEJS_18_X,
|
|
322
321
|
timeout: CdkDuration.minutes(15),
|
|
323
322
|
memorySize: 1024,
|
|
324
323
|
initialPolicy: [
|
|
@@ -347,11 +346,9 @@ export class EdgeFunction extends Construct {
|
|
|
347
346
|
S3Bucket: assetBucket,
|
|
348
347
|
S3Key: assetKey,
|
|
349
348
|
},
|
|
350
|
-
Runtime: runtime === "
|
|
351
|
-
? Runtime.
|
|
352
|
-
:
|
|
353
|
-
? Runtime.NODEJS_16_X.name
|
|
354
|
-
: Runtime.NODEJS_18_X.name,
|
|
349
|
+
Runtime: runtime === "nodejs16.x"
|
|
350
|
+
? Runtime.NODEJS_16_X.name
|
|
351
|
+
: Runtime.NODEJS_18_X.name,
|
|
355
352
|
MemorySize: typeof memorySize === "string"
|
|
356
353
|
? toCdkSize(memorySize).toMebibytes()
|
|
357
354
|
: memorySize,
|
|
@@ -382,7 +379,7 @@ export class EdgeFunction extends Construct {
|
|
|
382
379
|
provider = new CdkFunction(stack, providerId, {
|
|
383
380
|
code: Code.fromAsset(path.join(__dirname, "../support/edge-function")),
|
|
384
381
|
handler: "edge-lambda-version.handler",
|
|
385
|
-
runtime: Runtime.
|
|
382
|
+
runtime: Runtime.NODEJS_18_X,
|
|
386
383
|
timeout: CdkDuration.minutes(15),
|
|
387
384
|
memorySize: 1024,
|
|
388
385
|
initialPolicy: [
|
package/constructs/EventBus.js
CHANGED
|
@@ -248,7 +248,7 @@ export class EventBus extends Construct {
|
|
|
248
248
|
});
|
|
249
249
|
this.retrierFn = new lambda.Function(this, `RetrierFunction`, {
|
|
250
250
|
functionName: app.logicalPrefixedName(this.node.id + "Retrier"),
|
|
251
|
-
runtime: lambda.Runtime.
|
|
251
|
+
runtime: lambda.Runtime.NODEJS_18_X,
|
|
252
252
|
timeout: Duration.seconds(30),
|
|
253
253
|
handler: "index.handler",
|
|
254
254
|
code: lambda.Code.fromAsset(path.join(__dirname, "../support/event-bus-retrier")),
|
package/constructs/Function.d.ts
CHANGED
|
@@ -10,11 +10,10 @@ import * as functionUrlCors from "./util/functionUrlCors.js";
|
|
|
10
10
|
import { Architecture, Function as CDKFunction, FunctionOptions, ILayerVersion, Runtime as CDKRuntime, Tracing } from "aws-cdk-lib/aws-lambda";
|
|
11
11
|
import { RetentionDays } from "aws-cdk-lib/aws-logs";
|
|
12
12
|
import { Size as CDKSize, Duration as CDKDuration } from "aws-cdk-lib/core";
|
|
13
|
-
import {
|
|
13
|
+
import { Asset } from "aws-cdk-lib/aws-s3-assets";
|
|
14
14
|
declare const supportedRuntimes: {
|
|
15
15
|
container: CDKRuntime;
|
|
16
16
|
rust: CDKRuntime;
|
|
17
|
-
"nodejs14.x": CDKRuntime;
|
|
18
17
|
"nodejs16.x": CDKRuntime;
|
|
19
18
|
"nodejs18.x": CDKRuntime;
|
|
20
19
|
"python3.7": CDKRuntime;
|
|
@@ -127,7 +126,7 @@ export interface FunctionProps extends Omit<FunctionOptions, "functionName" | "m
|
|
|
127
126
|
* ```js
|
|
128
127
|
* new Function(stack, "Function", {
|
|
129
128
|
* handler: "function.handler",
|
|
130
|
-
* runtime: "
|
|
129
|
+
* runtime: "nodejs18.x",
|
|
131
130
|
* })
|
|
132
131
|
*```
|
|
133
132
|
*/
|
|
@@ -703,7 +702,7 @@ export declare class Function extends CDKFunction implements SSTConstruct {
|
|
|
703
702
|
type: "Function";
|
|
704
703
|
data: {
|
|
705
704
|
arn: string;
|
|
706
|
-
runtime: "container" | "rust" | "
|
|
705
|
+
runtime: "container" | "rust" | "nodejs16.x" | "nodejs18.x" | "python3.7" | "python3.8" | "python3.9" | "python3.10" | "python3.11" | "dotnetcore3.1" | "dotnet6" | "java8" | "java11" | "java17" | "go1.x" | "go" | undefined;
|
|
707
706
|
handler: string | undefined;
|
|
708
707
|
missingSourcemap: boolean | undefined;
|
|
709
708
|
localId: string;
|
|
@@ -729,13 +728,11 @@ export declare class Function extends CDKFunction implements SSTConstruct {
|
|
|
729
728
|
export declare const useFunctions: () => {
|
|
730
729
|
sourcemaps: {
|
|
731
730
|
add(stack: string, source: {
|
|
732
|
-
|
|
733
|
-
srcKey: string;
|
|
731
|
+
asset: Asset;
|
|
734
732
|
tarKey: string;
|
|
735
733
|
}): void;
|
|
736
734
|
forStack(stack: string): {
|
|
737
|
-
|
|
738
|
-
srcKey: string;
|
|
735
|
+
asset: Asset;
|
|
739
736
|
tarKey: string;
|
|
740
737
|
}[];
|
|
741
738
|
};
|
package/constructs/Function.js
CHANGED
|
@@ -31,7 +31,6 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
|
31
31
|
const supportedRuntimes = {
|
|
32
32
|
container: CDKRuntime.FROM_IMAGE,
|
|
33
33
|
rust: CDKRuntime.PROVIDED_AL2,
|
|
34
|
-
"nodejs14.x": CDKRuntime.NODEJS_14_X,
|
|
35
34
|
"nodejs16.x": CDKRuntime.NODEJS_16_X,
|
|
36
35
|
"nodejs18.x": CDKRuntime.NODEJS_18_X,
|
|
37
36
|
"python3.7": CDKRuntime.PYTHON_3_7,
|
|
@@ -114,7 +113,7 @@ export class Function extends CDKFunction {
|
|
|
114
113
|
code: Code.fromInline("export function placeholder() {}"),
|
|
115
114
|
handler: "index.placeholder",
|
|
116
115
|
functionName,
|
|
117
|
-
runtime: CDKRuntime.
|
|
116
|
+
runtime: CDKRuntime.NODEJS_18_X,
|
|
118
117
|
memorySize,
|
|
119
118
|
ephemeralStorageSize: diskSize,
|
|
120
119
|
timeout,
|
|
@@ -221,7 +220,7 @@ export class Function extends CDKFunction {
|
|
|
221
220
|
: {
|
|
222
221
|
code: Code.fromInline("export function placeholder() {}"),
|
|
223
222
|
handler: "index.placeholder",
|
|
224
|
-
runtime: CDKRuntime.
|
|
223
|
+
runtime: CDKRuntime.NODEJS_18_X,
|
|
225
224
|
layers: Function.buildLayers(scope, id, props),
|
|
226
225
|
}),
|
|
227
226
|
architecture,
|
|
@@ -257,8 +256,7 @@ export class Function extends CDKFunction {
|
|
|
257
256
|
});
|
|
258
257
|
await fs.rm(result.sourcemap);
|
|
259
258
|
useFunctions().sourcemaps.add(stack.stackName, {
|
|
260
|
-
|
|
261
|
-
srcKey: asset.s3ObjectKey,
|
|
259
|
+
asset,
|
|
262
260
|
tarKey: this.functionArn,
|
|
263
261
|
});
|
|
264
262
|
}
|
|
@@ -584,7 +582,13 @@ export const useFunctions = createAppContext(() => {
|
|
|
584
582
|
arr.push(source);
|
|
585
583
|
},
|
|
586
584
|
forStack(stack) {
|
|
587
|
-
return sourcemaps[stack] || []
|
|
585
|
+
return (sourcemaps[stack] || []).sort((a, b) => {
|
|
586
|
+
if (a.asset.node.path > b.asset.node.path)
|
|
587
|
+
return 1;
|
|
588
|
+
if (a.asset.node.path < b.asset.node.path)
|
|
589
|
+
return -1;
|
|
590
|
+
return 0;
|
|
591
|
+
});
|
|
588
592
|
},
|
|
589
593
|
},
|
|
590
594
|
fromID(id) {
|
package/constructs/Job.js
CHANGED
|
@@ -307,7 +307,7 @@ export class Job extends Construct {
|
|
|
307
307
|
return new CdkFunction(this, "Manager", {
|
|
308
308
|
code: Code.fromAsset(path.join(__dirname, "../support/job-manager/")),
|
|
309
309
|
handler: "index.handler",
|
|
310
|
-
runtime: Runtime.
|
|
310
|
+
runtime: Runtime.NODEJS_18_X,
|
|
311
311
|
timeout: CdkDuration.seconds(10),
|
|
312
312
|
memorySize: 1024,
|
|
313
313
|
environment: {
|
|
@@ -68,6 +68,7 @@ export interface NextjsSiteProps extends Omit<SsrSiteProps, "nodejs"> {
|
|
|
68
68
|
* experimental: {
|
|
69
69
|
* disableIncrementalCache: true,
|
|
70
70
|
* }
|
|
71
|
+
* ```
|
|
71
72
|
*/
|
|
72
73
|
disableIncrementalCache?: boolean;
|
|
73
74
|
/**
|
|
@@ -150,7 +151,7 @@ export declare class NextjsSite extends SsrSite {
|
|
|
150
151
|
layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
|
|
151
152
|
handler: string;
|
|
152
153
|
bundle?: string | undefined;
|
|
153
|
-
runtime?: "
|
|
154
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
154
155
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
155
156
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
156
157
|
permissions?: import("./index.js").Permissions | undefined;
|
|
@@ -197,20 +198,10 @@ export declare class NextjsSite extends SsrSite {
|
|
|
197
198
|
layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
|
|
198
199
|
handler: string;
|
|
199
200
|
bundle?: string | undefined;
|
|
200
|
-
runtime?: "
|
|
201
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
201
202
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
202
203
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
203
204
|
permissions?: import("./index.js").Permissions | undefined;
|
|
204
|
-
/**
|
|
205
|
-
* How the logs are stored in CloudWatch
|
|
206
|
-
* - "combined" - Logs from all routes are stored in the same log group.
|
|
207
|
-
* - "per-route" - Logs from each route are stored in a separate log group.
|
|
208
|
-
* @default "per-route"
|
|
209
|
-
* @example
|
|
210
|
-
* ```js
|
|
211
|
-
* logging: "combined",
|
|
212
|
-
* ```
|
|
213
|
-
*/
|
|
214
205
|
environment?: Record<string, string> | undefined;
|
|
215
206
|
bind?: import("./Construct.js").SSTConstruct[] | undefined;
|
|
216
207
|
nodejs?: import("./Function.js").NodeJSProps | undefined;
|
|
@@ -257,7 +248,7 @@ export declare class NextjsSite extends SsrSite {
|
|
|
257
248
|
layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
|
|
258
249
|
handler: string;
|
|
259
250
|
bundle?: string | undefined;
|
|
260
|
-
runtime?: "
|
|
251
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
261
252
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
262
253
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
263
254
|
permissions?: import("./index.js").Permissions | undefined;
|
|
@@ -304,20 +295,10 @@ export declare class NextjsSite extends SsrSite {
|
|
|
304
295
|
layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
|
|
305
296
|
handler: string;
|
|
306
297
|
bundle?: string | undefined;
|
|
307
|
-
runtime?: "
|
|
298
|
+
runtime?: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
308
299
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
309
300
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
310
301
|
permissions?: import("./index.js").Permissions | undefined;
|
|
311
|
-
/**
|
|
312
|
-
* How the logs are stored in CloudWatch
|
|
313
|
-
* - "combined" - Logs from all routes are stored in the same log group.
|
|
314
|
-
* - "per-route" - Logs from each route are stored in a separate log group.
|
|
315
|
-
* @default "per-route"
|
|
316
|
-
* @example
|
|
317
|
-
* ```js
|
|
318
|
-
* logging: "combined",
|
|
319
|
-
* ```
|
|
320
|
-
*/
|
|
321
302
|
environment?: Record<string, string> | undefined;
|
|
322
303
|
bind?: import("./Construct.js").SSTConstruct[] | undefined;
|
|
323
304
|
nodejs?: import("./Function.js").NodeJSProps | undefined;
|
|
@@ -357,7 +338,7 @@ export declare class NextjsSite extends SsrSite {
|
|
|
357
338
|
} | undefined;
|
|
358
339
|
mode: "placeholder" | "deployed";
|
|
359
340
|
path: string;
|
|
360
|
-
runtime: "
|
|
341
|
+
runtime: "nodejs16.x" | "nodejs18.x";
|
|
361
342
|
customDomainUrl: string | undefined;
|
|
362
343
|
url: string | undefined;
|
|
363
344
|
edge: boolean | undefined;
|
package/constructs/NextjsSite.js
CHANGED
|
@@ -615,8 +615,7 @@ export class NextjsSite extends SsrSite {
|
|
|
615
615
|
path: zipPath,
|
|
616
616
|
});
|
|
617
617
|
useFunctions().sourcemaps.add(stack.stackName, {
|
|
618
|
-
|
|
619
|
-
srcKey: asset.s3ObjectKey,
|
|
618
|
+
asset,
|
|
620
619
|
tarKey: path.join(server.functionArn, sourcemapKey),
|
|
621
620
|
});
|
|
622
621
|
});
|
package/constructs/RDS.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface RDSProps {
|
|
|
53
53
|
maxCapacity?: keyof typeof AuroraCapacityUnit;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
* Path to the directory that contains the migration scripts. The `RDS` construct uses [Kysely](https://kysely
|
|
56
|
+
* Path to the directory that contains the migration scripts. The `RDS` construct uses [Kysely](https://kysely.dev/) to run and manage schema migrations. The `migrations` prop should point to the folder where your migration files are.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
*
|
package/constructs/RDS.js
CHANGED
|
@@ -284,7 +284,7 @@ export class RDS extends Construct {
|
|
|
284
284
|
// For now we will do `__dirname/../dist` to make both cases work.
|
|
285
285
|
this.migratorFunction = new Fn(this, "MigrationFunction", {
|
|
286
286
|
handler: path.resolve(path.join(__dirname, "../support/rds-migrator/index.handler")),
|
|
287
|
-
runtime: "
|
|
287
|
+
runtime: "nodejs18.x",
|
|
288
288
|
timeout: 900,
|
|
289
289
|
memorySize: 1024,
|
|
290
290
|
environment: {
|
|
@@ -318,7 +318,7 @@ export class RDS extends Construct {
|
|
|
318
318
|
// Create custom resource handler
|
|
319
319
|
const handler = new Function(this, "MigrationHandler", {
|
|
320
320
|
code: Code.fromAsset(path.join(__dirname, "../support/script-function")),
|
|
321
|
-
runtime: Runtime.
|
|
321
|
+
runtime: Runtime.NODEJS_18_X,
|
|
322
322
|
handler: "index.handler",
|
|
323
323
|
timeout: CDKDuration.minutes(15),
|
|
324
324
|
memorySize: 1024,
|
|
@@ -99,7 +99,7 @@ export declare class RemixSite extends SsrSite {
|
|
|
99
99
|
data: {
|
|
100
100
|
mode: "placeholder" | "deployed";
|
|
101
101
|
path: string;
|
|
102
|
-
runtime: "
|
|
102
|
+
runtime: "nodejs16.x" | "nodejs18.x";
|
|
103
103
|
customDomainUrl: string | undefined;
|
|
104
104
|
url: string | undefined;
|
|
105
105
|
edge: boolean | undefined;
|
package/constructs/Script.js
CHANGED
|
@@ -121,7 +121,7 @@ export class Script extends Construct {
|
|
|
121
121
|
createCustomResourceFunction() {
|
|
122
122
|
const handler = new CdkFunction(this, "ScriptHandler", {
|
|
123
123
|
code: Code.fromAsset(path.join(__dirname, "../support/script-function")),
|
|
124
|
-
runtime: Runtime.
|
|
124
|
+
runtime: Runtime.NODEJS_18_X,
|
|
125
125
|
handler: "index.handler",
|
|
126
126
|
timeout: Duration.minutes(15),
|
|
127
127
|
memorySize: 1024,
|
|
@@ -79,7 +79,7 @@ export declare class SolidStartSite extends SsrSite {
|
|
|
79
79
|
data: {
|
|
80
80
|
mode: "placeholder" | "deployed";
|
|
81
81
|
path: string;
|
|
82
|
-
runtime: "
|
|
82
|
+
runtime: "nodejs16.x" | "nodejs18.x";
|
|
83
83
|
customDomainUrl: string | undefined;
|
|
84
84
|
url: string | undefined;
|
|
85
85
|
edge: boolean | undefined;
|
|
@@ -10,7 +10,7 @@ import { Duration } from "./util/duration.js";
|
|
|
10
10
|
export interface SsrFunctionProps extends Omit<FunctionOptions, "memorySize" | "timeout" | "runtime"> {
|
|
11
11
|
bundle?: string;
|
|
12
12
|
handler: string;
|
|
13
|
-
runtime?: "
|
|
13
|
+
runtime?: "nodejs16.x" | "nodejs18.x";
|
|
14
14
|
timeout?: number | Duration;
|
|
15
15
|
memorySize?: number | Size;
|
|
16
16
|
permissions?: Permissions;
|
|
@@ -50,7 +50,7 @@ export declare class SsrFunction extends Construct implements SSTConstruct {
|
|
|
50
50
|
type: "Function";
|
|
51
51
|
data: {
|
|
52
52
|
arn: string;
|
|
53
|
-
runtime: "
|
|
53
|
+
runtime: "nodejs16.x" | "nodejs18.x" | undefined;
|
|
54
54
|
handler: string;
|
|
55
55
|
missingSourcemap: boolean | undefined;
|
|
56
56
|
localId: string;
|
|
@@ -97,11 +97,7 @@ export class SsrFunction extends Construct {
|
|
|
97
97
|
handler: handler.split(path.sep).join(path.posix.sep),
|
|
98
98
|
logRetention: logRetention ?? RetentionDays.THREE_DAYS,
|
|
99
99
|
code: Code.fromBucket(Bucket.fromBucketName(this, "IServerFunctionBucket", assetBucket), assetKey),
|
|
100
|
-
runtime: runtime === "
|
|
101
|
-
? Runtime.NODEJS_14_X
|
|
102
|
-
: runtime === "nodejs16.x"
|
|
103
|
-
? Runtime.NODEJS_16_X
|
|
104
|
-
: Runtime.NODEJS_18_X,
|
|
100
|
+
runtime: runtime === "nodejs16.x" ? Runtime.NODEJS_16_X : Runtime.NODEJS_18_X,
|
|
105
101
|
architecture: architecture || Architecture.ARM_64,
|
|
106
102
|
memorySize: typeof memorySize === "string"
|
|
107
103
|
? toCdkSize(memorySize).toMebibytes()
|
|
@@ -195,8 +191,7 @@ export class SsrFunction extends Construct {
|
|
|
195
191
|
});
|
|
196
192
|
await fs.rm(result.sourcemap);
|
|
197
193
|
useFunctions().sourcemaps.add(stack.stackName, {
|
|
198
|
-
|
|
199
|
-
srcKey: asset.s3ObjectKey,
|
|
194
|
+
asset,
|
|
200
195
|
tarKey: this.functionArn,
|
|
201
196
|
});
|
|
202
197
|
}
|
package/constructs/SsrSite.d.ts
CHANGED
|
@@ -138,7 +138,7 @@ export interface SsrSiteProps {
|
|
|
138
138
|
* runtime: "nodejs16.x",
|
|
139
139
|
* ```
|
|
140
140
|
*/
|
|
141
|
-
runtime?: "
|
|
141
|
+
runtime?: "nodejs16.x" | "nodejs18.x";
|
|
142
142
|
/**
|
|
143
143
|
* Used to configure nodejs function properties
|
|
144
144
|
*/
|
|
@@ -454,7 +454,7 @@ export declare abstract class SsrSite extends Construct implements SSTConstruct
|
|
|
454
454
|
data: {
|
|
455
455
|
mode: "placeholder" | "deployed";
|
|
456
456
|
path: string;
|
|
457
|
-
runtime: "
|
|
457
|
+
runtime: "nodejs16.x" | "nodejs18.x";
|
|
458
458
|
customDomainUrl: string | undefined;
|
|
459
459
|
url: string | undefined;
|
|
460
460
|
edge: boolean | undefined;
|
package/constructs/SsrSite.js
CHANGED
|
@@ -568,7 +568,7 @@ function handler(event) {
|
|
|
568
568
|
return assets;
|
|
569
569
|
}
|
|
570
570
|
function createS3OriginDeployment(copy, s3Assets) {
|
|
571
|
-
const policy = new Policy(self, "
|
|
571
|
+
const policy = new Policy(self, "S3AssetUploaderPolicy", {
|
|
572
572
|
statements: [
|
|
573
573
|
new PolicyStatement({
|
|
574
574
|
effect: Effect.ALLOW,
|
|
@@ -588,7 +588,7 @@ function handler(event) {
|
|
|
588
588
|
],
|
|
589
589
|
});
|
|
590
590
|
stack.customResourceHandler.role?.attachInlinePolicy(policy);
|
|
591
|
-
const resource = new CustomResource(self, "
|
|
591
|
+
const resource = new CustomResource(self, "S3AssetUploader", {
|
|
592
592
|
serviceToken: stack.customResourceHandler.functionArn,
|
|
593
593
|
resourceType: "Custom::S3Uploader",
|
|
594
594
|
properties: {
|
package/constructs/Stack.js
CHANGED
|
@@ -196,7 +196,7 @@ export class Stack extends CDKStack {
|
|
|
196
196
|
assetHash: this.stackName + fs.readFileSync(dir + "/index.mjs").toString(),
|
|
197
197
|
}),
|
|
198
198
|
handler: "index.handler",
|
|
199
|
-
runtime: lambda.Runtime.
|
|
199
|
+
runtime: lambda.Runtime.NODEJS_18_X,
|
|
200
200
|
timeout: CDKDuration.seconds(900),
|
|
201
201
|
memorySize: 1024,
|
|
202
202
|
});
|
|
@@ -110,7 +110,7 @@ export declare class SvelteKitSite extends SsrSite {
|
|
|
110
110
|
data: {
|
|
111
111
|
mode: "placeholder" | "deployed";
|
|
112
112
|
path: string;
|
|
113
|
-
runtime: "
|
|
113
|
+
runtime: "nodejs16.x" | "nodejs18.x";
|
|
114
114
|
customDomainUrl: string | undefined;
|
|
115
115
|
url: string | undefined;
|
|
116
116
|
edge: boolean | undefined;
|
|
@@ -166,9 +166,13 @@ export interface WebSocketApiProps {
|
|
|
166
166
|
export interface WebSocketApiFunctionRouteProps {
|
|
167
167
|
type?: "function";
|
|
168
168
|
/**
|
|
169
|
-
*The function definition used to create the function for this route.
|
|
169
|
+
* The function definition used to create the function for this route.
|
|
170
170
|
*/
|
|
171
171
|
function: FunctionDefinition;
|
|
172
|
+
/**
|
|
173
|
+
* Should the route send a response to the client.
|
|
174
|
+
*/
|
|
175
|
+
returnResponse?: boolean;
|
|
172
176
|
}
|
|
173
177
|
/**
|
|
174
178
|
* Specify a Lambda authorizer and configure additional options.
|
|
@@ -363,6 +363,9 @@ export class WebSocketApi extends Construct {
|
|
|
363
363
|
routeKey,
|
|
364
364
|
integration: new WebSocketLambdaIntegration(`Integration_${routeKey}`, lambda),
|
|
365
365
|
authorizer: routeKey === "$connect" ? authorizer : undefined,
|
|
366
|
+
returnResponse: Fn.isInlineDefinition(routeValue)
|
|
367
|
+
? undefined
|
|
368
|
+
: routeValue.returnResponse,
|
|
366
369
|
});
|
|
367
370
|
///////////////////
|
|
368
371
|
// Configure authorization
|
|
@@ -47,7 +47,7 @@ export class DnsValidatedCertificate extends CertificateBase {
|
|
|
47
47
|
const requestorFunction = new lambda.Function(this, "CertificateRequestorFunction", {
|
|
48
48
|
code: lambda.Code.fromAsset(path.join(__dirname, "../../support/certificate-requestor")),
|
|
49
49
|
handler: "index.certificateRequestHandler",
|
|
50
|
-
runtime: lambda.Runtime.
|
|
50
|
+
runtime: lambda.Runtime.NODEJS_18_X,
|
|
51
51
|
timeout: Duration.minutes(15),
|
|
52
52
|
role: props.customResourceRole,
|
|
53
53
|
});
|
|
@@ -1039,10 +1039,7 @@ export class NextjsSite extends Construct {
|
|
|
1039
1039
|
return replaceValues;
|
|
1040
1040
|
}
|
|
1041
1041
|
normalizeRuntime(runtime) {
|
|
1042
|
-
if (runtime === "
|
|
1043
|
-
return lambda.Runtime.NODEJS_14_X;
|
|
1044
|
-
}
|
|
1045
|
-
else if (runtime === "nodejs16.x") {
|
|
1042
|
+
if (runtime === "nodejs16.x") {
|
|
1046
1043
|
return lambda.Runtime.NODEJS_16_X;
|
|
1047
1044
|
}
|
|
1048
1045
|
return lambda.Runtime.NODEJS_18_X;
|
|
@@ -18,7 +18,7 @@ export function getOrCreateBucket(scope) {
|
|
|
18
18
|
const provider = new lambda.Function(stack, providerId, {
|
|
19
19
|
code: lambda.Code.fromAsset(path.join(__dirname, "../../support/edge-function")),
|
|
20
20
|
handler: "s3-bucket.handler",
|
|
21
|
-
runtime: lambda.Runtime.
|
|
21
|
+
runtime: lambda.Runtime.NODEJS_18_X,
|
|
22
22
|
timeout: Duration.minutes(15),
|
|
23
23
|
memorySize: 1024,
|
|
24
24
|
initialPolicy: [
|
|
@@ -50,7 +50,7 @@ export function createFunction(scope, name, role, bucketName, functionParams) {
|
|
|
50
50
|
provider = new lambda.Function(stack, providerId, {
|
|
51
51
|
code: lambda.Code.fromAsset(path.join(__dirname, "../../support/edge-function")),
|
|
52
52
|
handler: "edge-lambda.handler",
|
|
53
|
-
runtime: lambda.Runtime.
|
|
53
|
+
runtime: lambda.Runtime.NODEJS_18_X,
|
|
54
54
|
timeout: Duration.minutes(15),
|
|
55
55
|
memorySize: 1024,
|
|
56
56
|
initialPolicy: [
|
|
@@ -88,7 +88,7 @@ export function createVersion(scope, name, functionArn) {
|
|
|
88
88
|
provider = new lambda.Function(stack, providerId, {
|
|
89
89
|
code: lambda.Code.fromAsset(path.join(__dirname, "../../support/edge-function")),
|
|
90
90
|
handler: "edge-lambda-version.handler",
|
|
91
|
-
runtime: lambda.Runtime.
|
|
91
|
+
runtime: lambda.Runtime.NODEJS_18_X,
|
|
92
92
|
timeout: Duration.minutes(15),
|
|
93
93
|
memorySize: 1024,
|
|
94
94
|
initialPolicy: [
|
|
@@ -36,7 +36,7 @@ type Event = {
|
|
|
36
36
|
metadataFn: any;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
type EventPayload<E extends Event> = {
|
|
39
|
+
export type EventPayload<E extends Event> = {
|
|
40
40
|
type: E["type"];
|
|
41
41
|
properties: E["shape"]["properties"];
|
|
42
42
|
metadata: undefined extends E["shape"]["metadata"] ? E["shape"]["metadataFn"] : E["shape"]["metadata"];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.36.
|
|
4
|
+
"version": "2.36.2",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sst": "cli/sst.js"
|
|
7
7
|
},
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@types/ws": "^8.5.3",
|
|
121
121
|
"@types/yargs": "^17.0.13",
|
|
122
122
|
"archiver": "^5.3.1",
|
|
123
|
-
"astro-sst": "2.36.
|
|
123
|
+
"astro-sst": "2.36.2",
|
|
124
124
|
"async": "^3.2.4",
|
|
125
125
|
"tsx": "^3.12.1",
|
|
126
126
|
"typescript": "^5.2.2",
|