Skip to main content

6 posts tagged with "Bun"

Bun - fast JavaScript all-in-one toolkit

View All Tags

Bun on Lambda: customer-managed runtime by default, 85 kB instead of 51 MB

· 10 min read
Ivan Barlog
AWS Solutions Architect @ BeeSolve

In the last post I wrote that I am going to update @beesolve/lambda-bun-runtime to use customer-managed runtimes (CMR). It is done. BunFunction now runs on a Bun runtime that I publish for every release, and the npm package went from about 51 MB to about 85 kB unpacked, because the layer zip is no longer inside it.

This is a major version (v4) with breaking changes, so here is what changed, what stayed, and what your options are.

Bun on Lambda Customer-Managed Runtimes: setup and benchmark

· 14 min read
Ivan Barlog
AWS Solutions Architect @ BeeSolve

AWS Lambda customer-managed runtimes (CMR) are generally available. I was part of the private beta and I used it to move my Bun runtime from a Lambda layer to a runtime Lambda actually knows about. Then I benchmarked it against the layer, a container image, SnapStart and the official nodejs24.x runtime.

The main reason to switch is updates, not speed: you publish a new runtime version, move an alias and your functions pick it up on the next cold start. The lower cold start is a bonus, and I measured that too.

Lambda Bun runtime rewrite

· 8 min read
Ivan Barlog
AWS Solutions Architect @ BeeSolve

When I created @beesolve/lambda-bun-runtime I mostly did it because it seems that the Lambda is very low on the Bun priority list and I wanted to have something which is up to date where I can fix the bugs quickly. I also wanted to provide better DX and tooling built around the CDK.

After using it for a while I realized that the approach of the official Bun's custom layer for Lambda does not align with my mindset.

Publishing CDK construct to Constructs Hub

· 17 min read
Ivan Barlog
AWS Solutions Architect @ BeeSolve

Two weeks ago I've published Lambda Bun Runtime and Lambda Keep Active CDK constructs which you can download and install from npm. I've also written about those in their respective articles.

Since there is strong community build around Constructs Hub I wanted my constructs to be available there as well. Unfortunatelly for me you need to use projen in order to be picked up by Construct Hub. So I have converted my repositories to projen repositories. This article is about my thorny path.

How to use S3 with Bun

· 2 min read
Ivan Barlog
AWS Solutions Architect @ BeeSolve

When I was trying Bun S3 client for the first time I was surprised that there is no option to pass AWS profile name as credentials. This post is just a quick memo for me to remember how this can be achieved.