sst 2.34.7 → 2.35.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.
- package/constructs/App.d.ts +1 -1
- package/constructs/App.js +1 -1
- package/constructs/Distribution.d.ts +1 -0
- package/constructs/Distribution.js +2 -1
- package/constructs/EdgeFunction.js +21 -5
- package/constructs/Function.d.ts +3 -4
- package/constructs/Function.js +2 -3
- package/constructs/Job.js +1 -1
- package/constructs/NextjsSite.d.ts +22 -16
- package/constructs/RemixSite.d.ts +2 -0
- package/constructs/RemixSite.js +3 -0
- package/constructs/Service.js +3 -1
- package/constructs/SolidStartSite.d.ts +2 -0
- package/constructs/SolidStartSite.js +3 -0
- package/constructs/SsrFunction.js +23 -5
- package/constructs/SsrSite.d.ts +21 -6
- package/constructs/SsrSite.js +2 -0
- package/constructs/StaticSite.js +2 -0
- package/constructs/deprecated/NextjsSite.d.ts +1 -1
- package/constructs/deprecated/NextjsSite.js +5 -5
- package/package.json +2 -2
package/constructs/App.d.ts
CHANGED
package/constructs/App.js
CHANGED
|
@@ -127,6 +127,7 @@ export declare class Distribution extends Construct {
|
|
|
127
127
|
version?: string;
|
|
128
128
|
paths?: string[];
|
|
129
129
|
wait?: boolean;
|
|
130
|
+
dependsOn?: IConstruct[];
|
|
130
131
|
}): CustomResource;
|
|
131
132
|
private validateCloudFrontDistributionSettings;
|
|
132
133
|
private validateCustomDomainSettings;
|
|
@@ -71,7 +71,7 @@ export class Distribution extends Construct {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
createInvalidation(props) {
|
|
74
|
-
const { version, paths, wait } = props ?? {};
|
|
74
|
+
const { version, paths, wait, dependsOn } = props ?? {};
|
|
75
75
|
const stack = Stack.of(this);
|
|
76
76
|
const policy = new Policy(this.scope, "CloudFrontInvalidatorPolicy", {
|
|
77
77
|
statements: [
|
|
@@ -100,6 +100,7 @@ export class Distribution extends Construct {
|
|
|
100
100
|
},
|
|
101
101
|
});
|
|
102
102
|
resource.node.addDependency(policy);
|
|
103
|
+
dependsOn?.forEach((c) => resource.node.addDependency(c));
|
|
103
104
|
return resource;
|
|
104
105
|
}
|
|
105
106
|
validateCloudFrontDistributionSettings() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import url from "url";
|
|
3
3
|
import path from "path";
|
|
4
|
+
import zlib from "zlib";
|
|
4
5
|
import crypto from "crypto";
|
|
5
6
|
import spawn from "cross-spawn";
|
|
6
7
|
import { Construct } from "constructs";
|
|
@@ -107,19 +108,34 @@ export class EdgeFunction extends Construct {
|
|
|
107
108
|
},
|
|
108
109
|
});
|
|
109
110
|
// Build function
|
|
110
|
-
const
|
|
111
|
+
const result = await useRuntimeHandlers().build(this.node.addr, "deploy");
|
|
111
112
|
// create wrapper that calls the handler
|
|
112
|
-
if (
|
|
113
|
+
if (result.type === "error")
|
|
113
114
|
throw new Error([
|
|
114
115
|
`There was a problem bundling the SSR function for the "${this.scope.node.id}" Site.`,
|
|
115
|
-
...
|
|
116
|
+
...result.errors,
|
|
116
117
|
].join("\n"));
|
|
118
|
+
// upload sourcemap
|
|
119
|
+
const stack = Stack.of(this);
|
|
120
|
+
if (result.sourcemap) {
|
|
121
|
+
const data = await fs.promises.readFile(result.sourcemap);
|
|
122
|
+
await fs.promises.writeFile(result.sourcemap, zlib.gzipSync(data));
|
|
123
|
+
const asset = new Asset(this, "Sourcemap", {
|
|
124
|
+
path: result.sourcemap,
|
|
125
|
+
});
|
|
126
|
+
await fs.promises.rm(result.sourcemap);
|
|
127
|
+
useFunctions().sourcemaps.add(stack.stackName, {
|
|
128
|
+
srcBucket: asset.bucket,
|
|
129
|
+
srcKey: asset.s3ObjectKey,
|
|
130
|
+
tarKey: this.functionArn,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
117
133
|
const asset = new Asset(this.scope, `FunctionAsset`, {
|
|
118
|
-
path:
|
|
134
|
+
path: result.out,
|
|
119
135
|
});
|
|
120
136
|
// Get handler filename
|
|
121
137
|
const isESM = (nodejs?.format || "esm") === "esm";
|
|
122
|
-
const parsed = path.parse(
|
|
138
|
+
const parsed = path.parse(result.handler);
|
|
123
139
|
const handlerFilename = `${parsed.dir}/${parsed.name}${isESM ? ".mjs" : ".cjs"}`;
|
|
124
140
|
return { asset, handlerFilename };
|
|
125
141
|
}
|
package/constructs/Function.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ import { IBucket } from "aws-cdk-lib/aws-s3";
|
|
|
14
14
|
declare const supportedRuntimes: {
|
|
15
15
|
container: CDKRuntime;
|
|
16
16
|
rust: CDKRuntime;
|
|
17
|
-
"nodejs12.x": CDKRuntime;
|
|
18
17
|
"nodejs14.x": CDKRuntime;
|
|
19
18
|
"nodejs16.x": CDKRuntime;
|
|
20
19
|
"nodejs18.x": CDKRuntime;
|
|
@@ -123,12 +122,12 @@ export interface FunctionProps extends Omit<FunctionOptions, "functionName" | "m
|
|
|
123
122
|
handler?: string;
|
|
124
123
|
/**
|
|
125
124
|
* The runtime environment for the function.
|
|
126
|
-
* @default "
|
|
125
|
+
* @default "nodejs18.x"
|
|
127
126
|
* @example
|
|
128
127
|
* ```js
|
|
129
128
|
* new Function(stack, "Function", {
|
|
130
129
|
* handler: "function.handler",
|
|
131
|
-
* runtime: "
|
|
130
|
+
* runtime: "nodejs16.x",
|
|
132
131
|
* })
|
|
133
132
|
*```
|
|
134
133
|
*/
|
|
@@ -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" | "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;
|
|
707
706
|
handler: string | undefined;
|
|
708
707
|
localId: string;
|
|
709
708
|
secrets: string[];
|
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
|
-
"nodejs12.x": CDKRuntime.NODEJS_12_X,
|
|
35
34
|
"nodejs14.x": CDKRuntime.NODEJS_14_X,
|
|
36
35
|
"nodejs16.x": CDKRuntime.NODEJS_16_X,
|
|
37
36
|
"nodejs18.x": CDKRuntime.NODEJS_18_X,
|
|
@@ -80,7 +79,7 @@ export class Function extends CDKFunction {
|
|
|
80
79
|
.forEach((per) => {
|
|
81
80
|
props = Function.mergeProps(per, props);
|
|
82
81
|
});
|
|
83
|
-
props.runtime = props.runtime || "
|
|
82
|
+
props.runtime = props.runtime || "nodejs18.x";
|
|
84
83
|
if (props.runtime === "go1.x")
|
|
85
84
|
useWarning().add("go.deprecated");
|
|
86
85
|
// Set defaults
|
|
@@ -126,7 +125,7 @@ export class Function extends CDKFunction {
|
|
|
126
125
|
});
|
|
127
126
|
}
|
|
128
127
|
// Handle local development (ie. sst start)
|
|
129
|
-
// - set runtime to
|
|
128
|
+
// - set runtime to nodejs for non-Node runtimes (b/c the stub is in Node)
|
|
130
129
|
// - set retry to 0. When the debugger is disconnected, the Cron construct
|
|
131
130
|
// will still try to periodically invoke the Lambda, and the requests would
|
|
132
131
|
// fail and retry. So when launching `sst start`, a couple of retry requests
|
package/constructs/Job.js
CHANGED
|
@@ -399,6 +399,6 @@ export class Job extends Construct {
|
|
|
399
399
|
}
|
|
400
400
|
convertJobRuntimeToFunctionRuntime() {
|
|
401
401
|
const { runtime } = this.props;
|
|
402
|
-
return runtime === "container" ? "container" : "
|
|
402
|
+
return runtime === "container" ? "container" : "nodejs18.x";
|
|
403
403
|
}
|
|
404
404
|
}
|
|
@@ -149,14 +149,7 @@ export declare class NextjsSite extends SsrSite {
|
|
|
149
149
|
function: {
|
|
150
150
|
layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
|
|
151
151
|
handler: string;
|
|
152
|
-
bundle?: string | undefined;
|
|
153
|
-
* OpenNext version for building the Next.js site.
|
|
154
|
-
* @default Latest OpenNext version
|
|
155
|
-
* @example
|
|
156
|
-
* ```js
|
|
157
|
-
* openNextVersion: "2.2.4",
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
152
|
+
bundle?: string | undefined;
|
|
160
153
|
runtime?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | undefined;
|
|
161
154
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
162
155
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
@@ -208,6 +201,16 @@ export declare class NextjsSite extends SsrSite {
|
|
|
208
201
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
209
202
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
210
203
|
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 "combined"
|
|
209
|
+
* @example
|
|
210
|
+
* ```js
|
|
211
|
+
* logging: "per-route",
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
211
214
|
environment?: Record<string, string> | undefined;
|
|
212
215
|
bind?: import("./Construct.js").SSTConstruct[] | undefined;
|
|
213
216
|
nodejs?: import("./Function.js").NodeJSProps | undefined;
|
|
@@ -253,14 +256,7 @@ export declare class NextjsSite extends SsrSite {
|
|
|
253
256
|
function: {
|
|
254
257
|
layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
|
|
255
258
|
handler: string;
|
|
256
|
-
bundle?: string | undefined;
|
|
257
|
-
* OpenNext version for building the Next.js site.
|
|
258
|
-
* @default Latest OpenNext version
|
|
259
|
-
* @example
|
|
260
|
-
* ```js
|
|
261
|
-
* openNextVersion: "2.2.4",
|
|
262
|
-
* ```
|
|
263
|
-
*/
|
|
259
|
+
bundle?: string | undefined;
|
|
264
260
|
runtime?: "nodejs14.x" | "nodejs16.x" | "nodejs18.x" | undefined;
|
|
265
261
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
266
262
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
@@ -312,6 +308,16 @@ export declare class NextjsSite extends SsrSite {
|
|
|
312
308
|
timeout?: number | `${number} second` | `${number} seconds` | `${number} minute` | `${number} minutes` | `${number} hour` | `${number} hours` | `${number} day` | `${number} days` | undefined;
|
|
313
309
|
memorySize?: number | `${number} MB` | `${number} GB` | undefined;
|
|
314
310
|
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 "combined"
|
|
316
|
+
* @example
|
|
317
|
+
* ```js
|
|
318
|
+
* logging: "per-route",
|
|
319
|
+
* ```
|
|
320
|
+
*/
|
|
315
321
|
environment?: Record<string, string> | undefined;
|
|
316
322
|
bind?: import("./Construct.js").SSTConstruct[] | undefined;
|
|
317
323
|
nodejs?: import("./Function.js").NodeJSProps | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SsrSite, SsrSiteNormalizedProps, SsrSiteProps } from "./SsrSite.js";
|
|
2
|
+
import { Construct } from "constructs";
|
|
2
3
|
export interface RemixSiteProps extends SsrSiteProps {
|
|
3
4
|
/**
|
|
4
5
|
* The server function is deployed to Lambda in a single region. Alternatively, you can enable this option to deploy to Lambda@Edge.
|
|
@@ -22,6 +23,7 @@ type RemixSiteNormalizedProps = RemixSiteProps & SsrSiteNormalizedProps;
|
|
|
22
23
|
*/
|
|
23
24
|
export declare class RemixSite extends SsrSite {
|
|
24
25
|
props: RemixSiteNormalizedProps;
|
|
26
|
+
constructor(scope: Construct, id: string, props?: RemixSiteProps);
|
|
25
27
|
protected plan(): {
|
|
26
28
|
cloudFrontFunctions?: {
|
|
27
29
|
serverCfFunction: {
|
package/constructs/RemixSite.js
CHANGED
|
@@ -21,6 +21,9 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export class RemixSite extends SsrSite {
|
|
24
|
+
constructor(scope, id, props) {
|
|
25
|
+
super(scope, id, props);
|
|
26
|
+
}
|
|
24
27
|
plan() {
|
|
25
28
|
const { path: sitePath, edge } = this.props;
|
|
26
29
|
const { handler, inject } = this.createServerLambdaBundle(edge ? "edge-server.js" : "regional-server.js");
|
package/constructs/Service.js
CHANGED
|
@@ -210,7 +210,9 @@ export class Service extends Construct {
|
|
|
210
210
|
this.updateContainerImage(dockerfile, taskDefinition, container);
|
|
211
211
|
}
|
|
212
212
|
// Invalidate CloudFront
|
|
213
|
-
this.distribution?.createInvalidation(
|
|
213
|
+
this.distribution?.createInvalidation({
|
|
214
|
+
wait: this.props.waitForInvalidation,
|
|
215
|
+
});
|
|
214
216
|
});
|
|
215
217
|
app.registerTypes(this);
|
|
216
218
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SsrSite, SsrSiteNormalizedProps, SsrSiteProps } from "./SsrSite.js";
|
|
2
|
+
import { Construct } from "constructs";
|
|
2
3
|
export interface SolidStartSiteProps extends SsrSiteProps {
|
|
3
4
|
/**
|
|
4
5
|
* The server function is deployed to Lambda in a single region. Alternatively, you can enable this option to deploy to Lambda@Edge.
|
|
@@ -20,6 +21,7 @@ type SolidStartSiteNormalizedProps = SolidStartSiteProps & SsrSiteNormalizedProp
|
|
|
20
21
|
*/
|
|
21
22
|
export declare class SolidStartSite extends SsrSite {
|
|
22
23
|
props: SolidStartSiteNormalizedProps;
|
|
24
|
+
constructor(scope: Construct, id: string, props?: SolidStartSiteProps);
|
|
23
25
|
protected plan(): {
|
|
24
26
|
cloudFrontFunctions?: {
|
|
25
27
|
serverCfFunction: {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import url from "url";
|
|
2
2
|
import path from "path";
|
|
3
|
+
import zlib from "zlib";
|
|
4
|
+
import fs from "fs/promises";
|
|
3
5
|
import spawn from "cross-spawn";
|
|
4
6
|
import { Construct } from "constructs";
|
|
5
7
|
import { Effect, Policy, PolicyStatement, } from "aws-cdk-lib/aws-iam";
|
|
@@ -16,6 +18,7 @@ import { attachPermissionsToRole } from "./util/permission.js";
|
|
|
16
18
|
import { toCdkSize } from "./util/size.js";
|
|
17
19
|
import { toCdkDuration } from "./util/duration.js";
|
|
18
20
|
import { useDeferredTasks } from "./deferred_task.js";
|
|
21
|
+
import { Asset } from "aws-cdk-lib/aws-s3-assets";
|
|
19
22
|
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
20
23
|
/////////////////////
|
|
21
24
|
// Construct
|
|
@@ -170,15 +173,30 @@ export class SsrFunction extends Construct {
|
|
|
170
173
|
nodejs: this.props.nodejs,
|
|
171
174
|
copyFiles: this.props.copyFiles,
|
|
172
175
|
});
|
|
173
|
-
//
|
|
174
|
-
const
|
|
176
|
+
// build function
|
|
177
|
+
const result = await useRuntimeHandlers().build(this.node.addr, "deploy");
|
|
175
178
|
// create wrapper that calls the handler
|
|
176
|
-
if (
|
|
179
|
+
if (result.type === "error")
|
|
177
180
|
throw new Error([
|
|
178
181
|
`There was a problem bundling the SSR function for the "${this.node.id}" Site.`,
|
|
179
|
-
...
|
|
182
|
+
...result.errors,
|
|
180
183
|
].join("\n"));
|
|
181
|
-
|
|
184
|
+
// upload sourcemap
|
|
185
|
+
const stack = Stack.of(this);
|
|
186
|
+
if (result.sourcemap) {
|
|
187
|
+
const data = await fs.readFile(result.sourcemap);
|
|
188
|
+
await fs.writeFile(result.sourcemap, zlib.gzipSync(data));
|
|
189
|
+
const asset = new Asset(this, "Sourcemap", {
|
|
190
|
+
path: result.sourcemap,
|
|
191
|
+
});
|
|
192
|
+
await fs.rm(result.sourcemap);
|
|
193
|
+
useFunctions().sourcemaps.add(stack.stackName, {
|
|
194
|
+
srcBucket: asset.bucket,
|
|
195
|
+
srcKey: asset.s3ObjectKey,
|
|
196
|
+
tarKey: this.functionArn,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return AssetCode.fromAsset(result.out);
|
|
182
200
|
}
|
|
183
201
|
async buildAssetFromBundle(bundle) {
|
|
184
202
|
// Note: cannot point the bundle to the `.open-next/server-function`
|
package/constructs/SsrSite.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Construct } from "constructs";
|
|
|
2
2
|
import { Bucket, BucketProps, IBucket } from "aws-cdk-lib/aws-s3";
|
|
3
3
|
import { Function as CdkFunction, FunctionProps as CdkFunctionProps } from "aws-cdk-lib/aws-lambda";
|
|
4
4
|
import { ICachePolicy, IResponseHeadersPolicy, ViewerProtocolPolicy, AllowedMethods, CachePolicyProps, ErrorResponse } from "aws-cdk-lib/aws-cloudfront";
|
|
5
|
+
import { S3OriginProps } from "aws-cdk-lib/aws-cloudfront-origins";
|
|
5
6
|
import { Schedule } from "aws-cdk-lib/aws-events";
|
|
6
7
|
import { DistributionDomainProps } from "./Distribution.js";
|
|
7
8
|
import { SSTConstruct } from "./Construct.js";
|
|
@@ -329,6 +330,20 @@ export interface SsrSiteProps {
|
|
|
329
330
|
* create the CDK `Distribution` internally.
|
|
330
331
|
*/
|
|
331
332
|
distribution?: SsrCdkDistributionProps;
|
|
333
|
+
/**
|
|
334
|
+
* Override the CloudFront S3 origin properties.
|
|
335
|
+
* @example
|
|
336
|
+
* ```js
|
|
337
|
+
* import { OriginAccessIdenty } from "aws-cdk-lib/aws-cloudfront";
|
|
338
|
+
*
|
|
339
|
+
* cdk: {
|
|
340
|
+
* s3Origin: {
|
|
341
|
+
* originAccessIdentity: OriginAccessIdentity.fromOriginAccessIdentityId(stack, "OriginAccessIdentity", "XXXXXXXX" ),
|
|
342
|
+
* },
|
|
343
|
+
* }
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
s3Origin?: S3OriginProps;
|
|
332
347
|
/**
|
|
333
348
|
* Override the CloudFront cache policy properties for responses from the
|
|
334
349
|
* server rendering Lambda.
|
|
@@ -341,12 +356,12 @@ export interface SsrSiteProps {
|
|
|
341
356
|
*
|
|
342
357
|
* ```js
|
|
343
358
|
* serverCachePolicy: new CachePolicy(this, "ServerCache", {
|
|
344
|
-
* queryStringBehavior: CacheQueryStringBehavior.all()
|
|
345
|
-
* headerBehavior: CacheHeaderBehavior.none()
|
|
346
|
-
* cookieBehavior: CacheCookieBehavior.none()
|
|
347
|
-
* defaultTtl: Duration.days(0)
|
|
348
|
-
* maxTtl: Duration.days(365)
|
|
349
|
-
* minTtl: Duration.days(0)
|
|
359
|
+
* queryStringBehavior: CacheQueryStringBehavior.all(),
|
|
360
|
+
* headerBehavior: CacheHeaderBehavior.none(),
|
|
361
|
+
* cookieBehavior: CacheCookieBehavior.none(),
|
|
362
|
+
* defaultTtl: Duration.days(0),
|
|
363
|
+
* maxTtl: Duration.days(365),
|
|
364
|
+
* minTtl: Duration.days(0),
|
|
350
365
|
* })
|
|
351
366
|
* ```
|
|
352
367
|
*/
|
package/constructs/SsrSite.js
CHANGED
|
@@ -414,6 +414,7 @@ function handler(event) {
|
|
|
414
414
|
function createS3Origin(props) {
|
|
415
415
|
const s3Origin = new S3Origin(bucket, {
|
|
416
416
|
originPath: "/" + (props.originPath ?? ""),
|
|
417
|
+
...(cdk?.s3Origin ?? {}),
|
|
417
418
|
});
|
|
418
419
|
const assets = createS3OriginAssets(props.copy);
|
|
419
420
|
const s3deployCR = createS3OriginDeployment(props.copy, assets);
|
|
@@ -757,6 +758,7 @@ function handler(event) {
|
|
|
757
758
|
version: invalidationBuildId,
|
|
758
759
|
paths: invalidationPaths,
|
|
759
760
|
wait: invalidation.wait,
|
|
761
|
+
dependsOn: s3DeployCRs,
|
|
760
762
|
});
|
|
761
763
|
}
|
|
762
764
|
}
|
package/constructs/StaticSite.js
CHANGED
|
@@ -75,6 +75,8 @@ export class StaticSite extends Construct {
|
|
|
75
75
|
// Invalidate CloudFront
|
|
76
76
|
this.distribution.createInvalidation({
|
|
77
77
|
version: this.generateInvalidationId(assets),
|
|
78
|
+
wait: this.props.waitForInvalidation,
|
|
79
|
+
dependsOn: [s3deployCR],
|
|
78
80
|
});
|
|
79
81
|
});
|
|
80
82
|
app.registerTypes(this);
|
|
@@ -1039,13 +1039,13 @@ export class NextjsSite extends Construct {
|
|
|
1039
1039
|
return replaceValues;
|
|
1040
1040
|
}
|
|
1041
1041
|
normalizeRuntime(runtime) {
|
|
1042
|
-
if (runtime === "
|
|
1043
|
-
return lambda.Runtime.NODEJS_12_X;
|
|
1044
|
-
}
|
|
1045
|
-
else if (runtime === "nodejs14.x") {
|
|
1042
|
+
if (runtime === "nodejs14.x") {
|
|
1046
1043
|
return lambda.Runtime.NODEJS_14_X;
|
|
1047
1044
|
}
|
|
1048
|
-
|
|
1045
|
+
else if (runtime === "nodejs16.x") {
|
|
1046
|
+
return lambda.Runtime.NODEJS_16_X;
|
|
1047
|
+
}
|
|
1048
|
+
return lambda.Runtime.NODEJS_18_X;
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
1051
|
export const useSites = createAppContext(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.35.1",
|
|
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.
|
|
123
|
+
"astro-sst": "2.35.1",
|
|
124
124
|
"async": "^3.2.4",
|
|
125
125
|
"tsx": "^3.12.1",
|
|
126
126
|
"typescript": "^5.2.2",
|