Open
Conversation
Add a lazy in-memory cache (liveBridgeCode) to avoid repeated creation/upload of live bridge code during dev. When dev=true, the code now builds a deterministic zip of the bundle (sorted files, zeroed timestamps, statConcurrency=1), hashes its contents, and uploads it as an s3.BucketObjectv2 using the region's bootstrap asset bucket. The Promise is cached by a region:bundle key and removed on failure to prevent duplicate work. Also thread the region value into the apply scope used for creating the zip and S3 object. This reduces repeated uploads and speeds up local development iterations.
Import pulumi and set the S3 BucketObjectv2 parent to pulumi.rootStackResource and pass opts?.provider. Also remove the component-specific name prefix from the BucketObjectv2 logical ID. These changes ensure the asset object is parented to the root stack resource and uses the correct provider, avoiding incorrect component scoping and provider resolution when creating the S3 object.
Collaborator
|
very cool @MaTTaDox let me take a look once we merge the aws v7 upgrade |
Replace usage of pulumi.rootStackResource and getRegionOutput(...).region with the imported rootStackResource and getRegionOutput(...).name. Also remove the namespace import of pulumi and import rootStackResource from @pulumi/pulumi. These changes standardize resource parent usage and access the region's name property where required in platform/src/components/aws/function.ts.
dsonet
reviewed
Feb 26, 2026
| ); | ||
| const partition = getPartitionOutput({}, opts).partition; | ||
| const region = getRegionOutput({}, opts).region; | ||
| const region = getRegionOutput({}, opts).name; |
There was a problem hiding this comment.
Shouldn't it be .region? I see all other places are using .region now
dsonet
reviewed
Mar 6, 2026
Comment on lines
-2822
to
+2900
| region: getRegionOutput(undefined, { parent: this }).region, | ||
| region: getRegionOutput(undefined, { parent: this }).name, |
Collaborator
|
thanks for your contribution @MaTTaDox haven't looked into this too much but from what i can remember i only seen logs like this when creating a new lambda function: in what cases does this pull request help then? when creating new functions? on live reload changes? initial startup times? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In dev mode, every aws.Function uploaded the same bridge zip as its own S3 object. This change deduplicates that upload so functions in the same region reuse one shared Live bridge asset.
Problem
Each Lambda in dev used identical bridge code (bootstrap from platform/dist/bridge) but still created/uploaded a per-function zip object.
This caused redundant uploads and long startup time of
sst devin bigger projectsChanges
Validation
I currently use the version with this change locally and it works way facter than before.
Breaking Changes
With this release the s3 key of every lambda in dev mode gets replaced once and old objects getting deleted
@vimtor would be awesome if you can have a look at this. I am also open to alternative suggestions for this problem.
Thank you!