From 602ddbfb58cbb19ded03f9c2b252821a5baf2cc3 Mon Sep 17 00:00:00 2001 From: Michael Aldape Date: Fri, 1 Mar 2024 12:36:00 -0600 Subject: [PATCH] Function: Don't overwrite Lambda description for Live Lambda development, just suffix label (#3674) * fix: don't overwrite Function description if provided, but always suffix Live Lambda label * update comment * add trim * add changeset * Sync --------- Co-authored-by: Frank --- .changeset/swift-chicken-float.md | 5 +++++ packages/sst/src/constructs/Function.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/swift-chicken-float.md diff --git a/.changeset/swift-chicken-float.md b/.changeset/swift-chicken-float.md new file mode 100644 index 0000000000..15469dfb24 --- /dev/null +++ b/.changeset/swift-chicken-float.md @@ -0,0 +1,5 @@ +--- +"sst": patch +--- + +Function: don't overwrite description, but add Live Lambda label diff --git a/packages/sst/src/constructs/Function.ts b/packages/sst/src/constructs/Function.ts index 2e5575f59c..337cfe6f1c 100644 --- a/packages/sst/src/constructs/Function.ts +++ b/packages/sst/src/constructs/Function.ts @@ -947,11 +947,16 @@ export class Function extends CDKFunction implements SSTConstruct { }; } + // Ensure descriptions fits the 256 chars limit + const description = props.description + ? `${props.description.substring(0, 240)} (live)` + : `live`; + super(scope, id, { ...props, ...(props.runtime === "container" ? { - description: "SST Live Lambda handler", + description, code: Code.fromAssetImage( path.resolve(__dirname, "../support/bridge"), { @@ -965,7 +970,7 @@ export class Function extends CDKFunction implements SSTConstruct { layers: undefined, } : { - description: "SST Live Lambda handler", + description, runtime: CDKRuntime.NODEJS_18_X, code: Code.fromAsset( path.resolve(__dirname, "../support/bridge")