sst 2.11.12 → 2.11.14

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.
@@ -570,6 +570,7 @@ export declare class Function extends CDKFunction implements SSTConstruct {
570
570
  type: "Function";
571
571
  data: {
572
572
  arn: string;
573
+ handler: string | undefined;
573
574
  localId: string;
574
575
  secrets: string[];
575
576
  };
@@ -316,6 +316,7 @@ export class Function extends CDKFunction {
316
316
  type: "Function",
317
317
  data: {
318
318
  arn: this.functionArn,
319
+ handler: this.props.handler,
319
320
  localId: this.node.addr,
320
321
  secrets: this.allBindings
321
322
  .filter((c) => c instanceof Secret)
@@ -1,5 +1,4 @@
1
1
  import fs from "fs";
2
- import url from "url";
3
2
  import path from "path";
4
3
  import { Fn, Duration as CdkDuration, RemovalPolicy, CustomResource, } from "aws-cdk-lib/core";
5
4
  import { Effect, Policy, PolicyStatement } from "aws-cdk-lib/aws-iam";
@@ -14,7 +13,6 @@ import { SsrFunction } from "./SsrFunction.js";
14
13
  import { EdgeFunction } from "./EdgeFunction.js";
15
14
  import { SsrSite } from "./SsrSite.js";
16
15
  import { toCdkSize } from "./util/size.js";
17
- const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
18
16
  /**
19
17
  * The `NextjsSite` construct is a higher level CDK construct that makes it easy to create a Next.js app.
20
18
  * @example
@@ -1,4 +1,5 @@
1
1
  import { Construct } from "constructs";
2
+ import { RetentionDays } from "aws-cdk-lib/aws-logs";
2
3
  import { FunctionOptions, Function as CdkFunction } from "aws-cdk-lib/aws-lambda";
3
4
  import { NodeJSProps, FunctionCopyFilesProps } from "./Function.js";
4
5
  import { SSTConstruct } from "./Construct.js";
@@ -16,6 +17,7 @@ export interface SsrFunctionProps extends Omit<FunctionOptions, "memorySize" | "
16
17
  bind?: SSTConstruct[];
17
18
  nodejs?: NodeJSProps;
18
19
  copyFiles?: FunctionCopyFilesProps[];
20
+ logRetention?: RetentionDays;
19
21
  }
20
22
  export declare class SsrFunction extends Construct {
21
23
  function: CdkFunction;
@@ -69,11 +69,11 @@ export class SsrFunction extends Construct {
69
69
  attachPermissionsToRole(this.function.role, permissions);
70
70
  }
71
71
  createFunction(assetBucket, assetKey) {
72
- const { runtime, timeout, memorySize, handler } = this.props;
72
+ const { runtime, timeout, memorySize, handler, logRetention } = this.props;
73
73
  return new CdkFunction(this, `ServerFunction`, {
74
74
  ...this.props,
75
75
  handler: handler.split(path.sep).join(path.posix.sep),
76
- logRetention: RetentionDays.THREE_DAYS,
76
+ logRetention: logRetention ?? RetentionDays.THREE_DAYS,
77
77
  code: Code.fromBucket(Bucket.fromBucketName(this, "IServerFunctionBucket", assetBucket), assetKey),
78
78
  runtime: runtime === "nodejs14.x"
79
79
  ? Runtime.NODEJS_14_X
@@ -87,6 +87,7 @@ export class SsrFunction extends Construct {
87
87
  timeout: typeof timeout === "string"
88
88
  ? toCdkDuration(timeout)
89
89
  : CdkDuration.seconds(timeout),
90
+ logRetentionRetryOptions: logRetention && { maxRetries: 100 },
90
91
  });
91
92
  }
92
93
  createCodeReplacer(assetBucket, assetKey) {
@@ -188,7 +188,7 @@ export interface SsrSiteProps {
188
188
  * from the server rendering Lambda.
189
189
  */
190
190
  responseHeadersPolicy?: IResponseHeadersPolicy;
191
- server?: Pick<FunctionProps, "vpc" | "vpcSubnets" | "securityGroups" | "allowAllOutbound" | "allowPublicSubnet" | "architecture">;
191
+ server?: Pick<FunctionProps, "vpc" | "vpcSubnets" | "securityGroups" | "allowAllOutbound" | "allowPublicSubnet" | "architecture" | "logRetention">;
192
192
  };
193
193
  }
194
194
  type SsrSiteNormalizedProps = SsrSiteProps & {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.11.12",
4
+ "version": "2.11.14",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },