Skip to content

Commit

Permalink
Function: Don't overwrite Lambda description for Live Lambda developm…
Browse files Browse the repository at this point in the history
…ent, 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 <frank@sst.dev>
  • Loading branch information
mikeyaa and fwang committed Mar 1, 2024
1 parent d3f0a3a commit 602ddbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-chicken-float.md
@@ -0,0 +1,5 @@
---
"sst": patch
---

Function: don't overwrite description, but add Live Lambda label
9 changes: 7 additions & 2 deletions packages/sst/src/constructs/Function.ts
Expand Up @@ -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"),
{
Expand All @@ -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")
Expand Down

0 comments on commit 602ddbf

Please sign in to comment.