sst 2.36.1 → 2.36.3

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 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.NODEJS_16_X
206
+ ? Runtime.NODEJS_18_X
207
207
  : Runtime.NODEJS_18_X,
208
208
  environment: {
209
209
  BUCKET_NAME: bucket.bucketName,
@@ -110,7 +110,7 @@ export declare class App extends CDKApp {
110
110
  * @example
111
111
  * ```js
112
112
  * app.setDefaultFunctionProps({
113
- * runtime: "nodejs16.x",
113
+ * runtime: "nodejs18.x",
114
114
  * timeout: 30
115
115
  * })
116
116
  * ```
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: "nodejs16.x",
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].srcBucket.bucketArn + "/*",
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].srcBucket.bucketName,
291
- sourcemaps: sourcemaps.map((s) => [s.tarKey, s.srcKey]),
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: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
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?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
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
- srcBucket: asset.bucket,
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.NODEJS_16_X,
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.NODEJS_16_X,
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 === "nodejs14.x"
351
- ? Runtime.NODEJS_14_X.name
352
- : runtime === "nodejs16.x"
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.NODEJS_16_X,
382
+ runtime: Runtime.NODEJS_18_X,
386
383
  timeout: CdkDuration.minutes(15),
387
384
  memorySize: 1024,
388
385
  initialPolicy: [
@@ -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.NODEJS_16_X,
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")),
@@ -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 { IBucket } from "aws-cdk-lib/aws-s3";
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: "nodejs16.x",
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" | "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | "python3.7" | "python3.8" | "python3.9" | "python3.10" | "python3.11" | "dotnetcore3.1" | "dotnet6" | "java8" | "java11" | "java17" | "go1.x" | "go" | undefined;
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
- srcBucket: IBucket;
733
- srcKey: string;
731
+ asset: Asset;
734
732
  tarKey: string;
735
733
  }): void;
736
734
  forStack(stack: string): {
737
- srcBucket: IBucket;
738
- srcKey: string;
735
+ asset: Asset;
739
736
  tarKey: string;
740
737
  }[];
741
738
  };
@@ -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.NODEJS_16_X,
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.NODEJS_16_X,
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
- srcBucket: asset.bucket,
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.NODEJS_16_X,
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?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | undefined;
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?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | undefined;
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?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | undefined;
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?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | undefined;
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: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
341
+ runtime: "nodejs16.x" | "nodejs18.x";
361
342
  customDomainUrl: string | undefined;
362
343
  url: string | undefined;
363
344
  edge: boolean | undefined;
@@ -339,17 +339,19 @@ export class NextjsSite extends SsrSite {
339
339
  const injections = [];
340
340
  if (this.isPerRouteLoggingEnabled()) {
341
341
  injections.push(`
342
- const routeData = ${JSON.stringify(this.useRoutes().map(({ regex, logGroupPath }) => ({
342
+ if (event.rawPath) {
343
+ const routeData = ${JSON.stringify(this.useRoutes().map(({ regex, logGroupPath }) => ({
343
344
  regex,
344
345
  logGroupPath,
345
346
  })))}.find(({ regex }) => event.rawPath.match(new RegExp(regex)));
346
- if (routeData) {
347
- console.log("::sst::" + JSON.stringify({
348
- action:"log.split",
349
- properties: {
350
- logGroupName:"/sst/lambda/" + context.functionName + routeData.logGroupPath,
351
- },
352
- }));
347
+ if (routeData) {
348
+ console.log("::sst::" + JSON.stringify({
349
+ action:"log.split",
350
+ properties: {
351
+ logGroupName:"/sst/lambda/" + context.functionName + routeData.logGroupPath,
352
+ },
353
+ }));
354
+ }
353
355
  }`);
354
356
  }
355
357
  fs.writeFileSync(path.join(serverPath, `${wrapperName}.mjs`), experimental?.streaming
@@ -615,8 +617,7 @@ export class NextjsSite extends SsrSite {
615
617
  path: zipPath,
616
618
  });
617
619
  useFunctions().sourcemaps.add(stack.stackName, {
618
- srcBucket: asset.bucket,
619
- srcKey: asset.s3ObjectKey,
620
+ asset,
620
621
  tarKey: path.join(server.functionArn, sourcemapKey),
621
622
  });
622
623
  });
@@ -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-org.github.io/kysely/) to run and manage schema migrations. The `migrations` prop should point to the folder where your migration files are.
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: "nodejs16.x",
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.NODEJS_16_X,
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: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
102
+ runtime: "nodejs16.x" | "nodejs18.x";
103
103
  customDomainUrl: string | undefined;
104
104
  url: string | undefined;
105
105
  edge: boolean | undefined;
@@ -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.NODEJS_16_X,
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: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
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?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
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: "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | undefined;
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 === "nodejs14.x"
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
- srcBucket: asset.bucket,
199
- srcKey: asset.s3ObjectKey,
194
+ asset,
200
195
  tarKey: this.functionArn,
201
196
  });
202
197
  }
@@ -138,7 +138,7 @@ export interface SsrSiteProps {
138
138
  * runtime: "nodejs16.x",
139
139
  * ```
140
140
  */
141
- runtime?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
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: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
457
+ runtime: "nodejs16.x" | "nodejs18.x";
458
458
  customDomainUrl: string | undefined;
459
459
  url: string | undefined;
460
460
  edge: boolean | undefined;
@@ -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, "S3UploaderPolicy", {
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, "S3Uploader", {
591
+ const resource = new CustomResource(self, "S3AssetUploader", {
592
592
  serviceToken: stack.customResourceHandler.functionArn,
593
593
  resourceType: "Custom::S3Uploader",
594
594
  properties: {
@@ -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.NODEJS_16_X,
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: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
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.NODEJS_16_X,
50
+ runtime: lambda.Runtime.NODEJS_18_X,
51
51
  timeout: Duration.minutes(15),
52
52
  role: props.customResourceRole,
53
53
  });
@@ -83,7 +83,7 @@ export interface NextjsSiteProps {
83
83
  * })
84
84
  *```
85
85
  */
86
- runtime?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
86
+ runtime?: "nodejs16.x" | "nodejs18.x";
87
87
  };
88
88
  };
89
89
  /**
@@ -1039,10 +1039,7 @@ export class NextjsSite extends Construct {
1039
1039
  return replaceValues;
1040
1040
  }
1041
1041
  normalizeRuntime(runtime) {
1042
- if (runtime === "nodejs14.x") {
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.NODEJS_16_X,
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.NODEJS_16_X,
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.NODEJS_16_X,
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.1",
4
+ "version": "2.36.3",
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.1",
123
+ "astro-sst": "2.36.3",
124
124
  "async": "^3.2.4",
125
125
  "tsx": "^3.12.1",
126
126
  "typescript": "^5.2.2",
package/project.js CHANGED
@@ -48,7 +48,7 @@ export async function initProject(globals) {
48
48
  // Logger.debug("loaded sst config");
49
49
  return [metafile, config];
50
50
  }
51
- throw new VisibleError("Could not found a configuration file", "Make sure one of the following exists", ...CONFIG_EXTENSIONS.map((x) => ` - sst${x}`));
51
+ throw new VisibleError("Could not find a configuration file", "Make sure one of the following exists", ...CONFIG_EXTENSIONS.map((x) => ` - sst${x}`));
52
52
  })();
53
53
  const config = await Promise.resolve(sstConfig.config(globals));
54
54
  const stage = process.env.SST_STAGE ||
@@ -163,7 +163,7 @@ async function promptPersonalStage(out, isRetry) {
163
163
  async function findRoot() {
164
164
  async function find(dir) {
165
165
  if (dir === "/")
166
- throw new VisibleError("Could not found a configuration file", "Make sure one of the following exists", ...CONFIG_EXTENSIONS.map((ext) => ` - sst${ext}`));
166
+ throw new VisibleError("Could not find a configuration file", "Make sure one of the following exists", ...CONFIG_EXTENSIONS.map((ext) => ` - sst${ext}`));
167
167
  for (const ext of CONFIG_EXTENSIONS) {
168
168
  const configPath = path.join(dir, `sst${ext}`);
169
169
  if (fsSync.existsSync(configPath)) {