sst 2.8.22 → 2.8.23
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/SsrFunction.js +1 -1
- package/constructs/SsrSite.js +15 -12
- package/package.json +1 -1
|
@@ -72,7 +72,7 @@ export class SsrFunction extends Construct {
|
|
|
72
72
|
const { runtime, timeout, memorySize, handler } = this.props;
|
|
73
73
|
return new CdkFunction(this, `ServerFunction`, {
|
|
74
74
|
...this.props,
|
|
75
|
-
handler,
|
|
75
|
+
handler: handler.split(path.sep).join(path.posix.sep),
|
|
76
76
|
logRetention: RetentionDays.THREE_DAYS,
|
|
77
77
|
code: Code.fromBucket(Bucket.fromBucketName(this, "IServerFunctionBucket", assetBucket), assetKey),
|
|
78
78
|
runtime: runtime === "nodejs14.x"
|
package/constructs/SsrSite.js
CHANGED
|
@@ -359,16 +359,13 @@ export class SsrSite extends Construct {
|
|
|
359
359
|
return cdk.bucket;
|
|
360
360
|
}
|
|
361
361
|
// cdk.bucket is a prop
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
...bucketProps,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
362
|
+
return new Bucket(this, "S3Bucket", {
|
|
363
|
+
publicReadAccess: false,
|
|
364
|
+
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
365
|
+
autoDeleteObjects: true,
|
|
366
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
367
|
+
...cdk?.bucket,
|
|
368
|
+
});
|
|
372
369
|
}
|
|
373
370
|
createS3Deployment(cliLayer, assets, fileOptions) {
|
|
374
371
|
// Create a Lambda function that will be doing the uploading
|
|
@@ -545,7 +542,6 @@ function handler(event) {
|
|
|
545
542
|
});
|
|
546
543
|
return {
|
|
547
544
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
548
|
-
functionAssociations: this.buildBehaviorFunctionAssociations(),
|
|
549
545
|
origin: new HttpOrigin(Fn.parseDomainName(fnUrl.url)),
|
|
550
546
|
allowedMethods: AllowedMethods.ALLOW_ALL,
|
|
551
547
|
cachedMethods: CachedMethods.CACHE_GET_HEAD_OPTIONS,
|
|
@@ -553,6 +549,10 @@ function handler(event) {
|
|
|
553
549
|
cachePolicy: cdk?.serverCachePolicy ?? this.buildServerCachePolicy(),
|
|
554
550
|
originRequestPolicy: this.buildServerOriginRequestPolicy(),
|
|
555
551
|
...(cfDistributionProps.defaultBehavior || {}),
|
|
552
|
+
functionAssociations: [
|
|
553
|
+
...this.buildBehaviorFunctionAssociations(),
|
|
554
|
+
...(cfDistributionProps.defaultBehavior?.functionAssociations || []),
|
|
555
|
+
],
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
558
|
buildDefaultBehaviorForEdge(origin) {
|
|
@@ -560,7 +560,6 @@ function handler(event) {
|
|
|
560
560
|
const cfDistributionProps = cdk?.distribution || {};
|
|
561
561
|
return {
|
|
562
562
|
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
563
|
-
functionAssociations: this.buildBehaviorFunctionAssociations(),
|
|
564
563
|
origin,
|
|
565
564
|
allowedMethods: AllowedMethods.ALLOW_ALL,
|
|
566
565
|
cachedMethods: CachedMethods.CACHE_GET_HEAD_OPTIONS,
|
|
@@ -568,6 +567,10 @@ function handler(event) {
|
|
|
568
567
|
cachePolicy: cdk?.serverCachePolicy ?? this.buildServerCachePolicy(),
|
|
569
568
|
originRequestPolicy: this.buildServerOriginRequestPolicy(),
|
|
570
569
|
...(cfDistributionProps.defaultBehavior || {}),
|
|
570
|
+
functionAssociations: [
|
|
571
|
+
...this.buildBehaviorFunctionAssociations(),
|
|
572
|
+
...(cfDistributionProps.defaultBehavior?.functionAssociations || []),
|
|
573
|
+
],
|
|
571
574
|
edgeLambdas: [
|
|
572
575
|
{
|
|
573
576
|
includeBody: true,
|