Skip to content

feat!: v4 - Bun customer-managed runtime by default, published public artifacts - #16

Merged
ivanbarlog merged 6 commits into
mainfrom
feat/v4-public-artifacts
Nov 23, 2026
Merged

ivanbarlog merged 6 commits into
mainfrom
feat/v4-public-artifacts

Conversation

@ivanbarlog

Copy link
Copy Markdown
Contributor

Implements ADR: Public artifacts for v4.

Breaking changes

  • BunFunction now runs on the Bun customer-managed runtime (CMR). It sets runtimeConfig with lambda.mixins.FunctionRuntimeConfig, so aws-cdk-lib 2.278.0 or newer is required. bunRuntime: { runtimeArn, runtimeAlias } overrides the published runtime.
  • BunFunctionWithLayer is the new construct for the layer path (bunLayer is required there). CMR and layer never share a construct.
  • The npm package no longer ships the layer zip. BunLambdaLayer references the layer published for the package version (layerVersionArn or assetZipPath for your own).
  • Outside eu-north-1, eu-central-1, eu-west-1, us-east-1 and us-west-2, users publish their own runtime (bun-lambda-runtime publish-runtime) or build a layer (bun-lambda-runtime build-layer).

Publishing

  • command/publishRuntime.ts builds the runtime image (GitHub release Bun binary on provided:al2023), pushes it to ECR, creates the runtime bun, a version named after the package version, and aliases <x.y.z>, <x.y> (default), <x>, latest, plus pkg-<package version> (never moved). Moving aliases never move to an older version. The same code backs the CLI command and the release workflow.
  • release.yml: publishes layer and runtime to eu-central-1, runs the integration test against them (including a CMR function), then publishes all five regions (idempotent), sets the moving aliases, makes the runtime public, and publishes to npm.
  • publish-smoke.yml: publishes a throwaway runtime version to one region, for checking the publish role.

Verified

  • Unit tests, tsc and lint pass.
  • publish-smoke.yml ran green against the production account (403247376652, eu-central-1).
  • A BunFunction deployed with CDK in the test account on the production runtime (runtime/bun, cross-account) ran and echoed its payload.
  • The sample app's aws-cdk CLI is upgraded to 2.1149 to read assemblies from aws-cdk-lib 2.278.

Not verified

  • A full release.yml run, including all five regions, the moving aliases and --public through the workflow.
  • IAM actions for the publish role come from the Lambda docs, only partly exercised by the smoke run (no alias moves, no public policy via the role).

After merging

Run release manually with Bun 1.4.5.

…yer CLI

- BunLambdaLayer resolves the published layer ARN from artifacts.json by region
  (layerVersionArn or assetZipPath for other regions); BunFunction takes any ILayerVersion
- Package no longer ships the layer zip (tarball ~44 KB)
- bun-lambda-runtime build-layer CLI (dist/cli.js) builds the layer zip
- Docs: custom-layer how-to, README, DOCS.md, ADR decisions
- command/publishLayer.ts: idempotent publish + public share per region (SDK)
- command/writeArtifacts.ts: merge per-region results into src/artifacts.json
- release.yml: build zip, publish eu-central-1, integration test on the published
  layer, publish the other regions, then GitHub release and npm
- integration.yml: published-layer input; PR runs deploy a layer built from source
- docs: OIDC setup for the artifacts account, exec policy for the published layer
@ivanbarlog
ivanbarlog merged commit e88e0bd into main Nov 23, 2026
3 checks passed
@ivanbarlog
ivanbarlog deleted the feat/v4-public-artifacts branch November 23, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant