Skip to content

feat: add multi-tenancy support via tenant ID propagation#631

Merged
bnusunny merged 3 commits intomainfrom
feat/multi-tenancy
Feb 16, 2026
Merged

feat: add multi-tenancy support via tenant ID propagation#631
bnusunny merged 3 commits intomainfrom
feat/multi-tenancy

Conversation

@bnusunny
Copy link
Contributor

Summary

Adds multi-tenancy support to Lambda Web Adapter by propagating the tenant_id from the Lambda runtime context as an X-Amz-Tenant-Id HTTP header to the downstream web application.

Changes

  • Extract tenant_id from the Lambda Context (populated from the lambda-runtime-aws-tenant-id runtime header)
  • Forward it as X-Amz-Tenant-Id header when present; omit when absent
  • Unit tests and integration tests for both present and absent tenant ID scenarios
  • Updated README with multi-tenancy documentation and usage examples

How it works

When the Lambda runtime includes a tenant_id in the invocation context, the adapter automatically adds it as an X-Amz-Tenant-Id header on the forwarded request. No configuration is needed — if the tenant ID is present, it's propagated; if not, the header is simply omitted.

Extract tenant_id from the Lambda runtime context and forward it
as the X-Amz-Tenant-Id header to the downstream web application.
The header is only added when tenant_id is present in the context.

Includes unit and integration tests for both present and absent
tenant_id scenarios.
@github-actions
Copy link

github-actions bot commented Feb 16, 2026

📊 Benchmark Comparison

Benchmark Details
  • Baseline: main branch
  • Comparison: This PR
  • Threshold: 10% regression triggers warning

@bnusunny bnusunny merged commit b9d8ec5 into main Feb 16, 2026
26 checks passed
@bnusunny bnusunny deleted the feat/multi-tenancy branch February 16, 2026 18:11
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.

3 participants