mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-24 09:03:15 -05:00
[PR #5591] RFC: AWS Serverless Support #24504
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/5591
Author: @txase
Created: 2/14/2025
Status: 🔄 Open
Base:
main← Head:main📝 Commits (3)
e7f2442mail: add AWS SES transportb590429db: add Aurora DSQL backendbd12af6aws: add Lambda deployment assets📊 Changes
40 files changed (+1578 additions, -28 deletions)
View changed files
➕
.github/workflows/lambda.yml(+49 -0)📝
Cargo.lock(+55 -0)📝
Cargo.toml(+5 -0)➕
CargoLambda.toml(+7 -0)➕
aws/.gitignore(+3 -0)➕
aws/README.md(+60 -0)➕
aws/build-lambda.sh(+74 -0)➕
aws/deploy.sh(+9 -0)➕
aws/samconfig.toml(+12 -0)➕
aws/template.yaml(+711 -0)📝
build.rs(+10 -1)➕
migrations/dsql/2024-12-30-100000_create_tables/metadata.toml(+1 -0)➕
migrations/dsql/2024-12-30-100000_create_tables/up.sql(+281 -0)➕
migrations/dsql/2025-01-09-172300_add_manage/down.sql(+0 -0)➕
migrations/dsql/2025-01-09-172300_add_manage/metadata.toml(+1 -0)➕
migrations/dsql/2025-01-09-172300_add_manage/up.sql(+8 -0)➕
migrations/dsql/2025-08-20-120000_add_users_organizations_invited_by_email/down.sql(+1 -0)➕
migrations/dsql/2025-08-20-120000_add_users_organizations_invited_by_email/metadata.toml(+1 -0)➕
migrations/dsql/2025-08-20-120000_add_users_organizations_invited_by_email/up.sql(+2 -0)➕
migrations/dsql/2025-08-20-120100_add_sso_users/down.sql(+1 -0)...and 20 more files
📄 Description
This draft PR contains a POC of support for deploying an instance of Vaultwarden into an AWS account using entirely "serverless" services (likely falling within the free-tier usage limits as well). I'm looking for feedback and agreement by Vaultwarden maintainers on whether these contributions could be merged into vaultwarden (with further refinement).
Architecture
All of this is implemented in the PR behind feature flags:
dsql,s3, andses. All three can be enabled together via theawsfeature flag.Unimplemented Functionality
I believe all functionality, except as listed below, is functional. But I'm new to vaultwarden and may have missed something along the way. I've not found any significant issues with my own usage due to this missing functionality, however.
Open Questions / Concerns
POSTinstead of S3'sPUTto upload, and although S3 also supportsPOSTwith signed URLs the data must be form-encoded. This means existing Bitwarden clients cannot upload directly to S3, and must instead upload through the API Lambda Function. Unfortunately, the AWS Lambda service has a 6 MB size limit for request payloads. Note: This only applies to uploads, downloads are streamed from S3 directly via signedGETURLs which do not have a size limit.Deployment Instructions
See the aws/README.md file in this PR.
Proposed Plan of Attack
This PR is too large to attempt to review and merge with sanity. With agreement from Vaultwarden maintainers in comments below, I propose developing and merging the following as separate PRs in sequence:
persistent_fsmodule, migrating existing filesystem functionality into a "local" backend implementation. Seesrc/persistent_fs/mod.rsandsrc/persistent_fs/local.rs. This would not change any functionality; it would simply rearchitect file access in preparation for the addition of an S3 backend.dsql-beta)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.