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.
@@ -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"
@@ -359,16 +359,13 @@ export class SsrSite extends Construct {
359
359
  return cdk.bucket;
360
360
  }
361
361
  // cdk.bucket is a prop
362
- else {
363
- const bucketProps = cdk?.bucket;
364
- return new Bucket(this, "S3Bucket", {
365
- publicReadAccess: false,
366
- blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
367
- autoDeleteObjects: true,
368
- removalPolicy: RemovalPolicy.DESTROY,
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,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.8.22",
4
+ "version": "2.8.23",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },