mongo-lambda-backup
Backup MongoDB databases using AWS Lambda functions
The code in this repo allows running the backup of a MongoDB database to S3 on AWS Lambda by emulating a mongodump using pymongo and boto3. By default the function will create a JSON file for every collection in the database and save them in a /backup folder.
Install from pip
pip install mongo_lambda_backup
Configuration
All configuration values are passed using environment variables.
The following values are required:
MONGO_URI: The URI (including authentication credentials if needed) of the MongoDB host to be backed up. In case this contains credentials you can encrypt this value using AWS KMS and setMONGO_URI_IS_ENCRYPTEDto tell the Lambda it needs to decrypt the given value.BUCKET_NAME: The name of the S3 bucket to store the backup files in.
The following values are optional:
MONGO_URI_IS_ENCRYPTED: In case this environment variable is set, the handler assumes the URI (which potentially contains credentials) needs to be encrypted using the KMS key associated with the Lambda.MONGO_DATABASE: The name of the database to back up. In case this is not set, it will be read from the path ofMONGO_URI.BUCKET_FOLDER: The folder in the bucket to store the JSON files in. Defaults tobackups.COLLECTION_BLACKLIST: A comma-separated collection of collection names to skip when performing the back up (e.g. for skipping indices or vendor specific databases).IN_MEMORY: If set, the collection to be dumped to S3 will be handled in the Lambda's memory before writing. This might affect both backup speed as well as Lambda Limits in certain scenarios.
License
MIT © Frederik Ring
Metadata
Release files for mongo-lambda-backup 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mongo_lambda_backup-0.3.0.tar.gz | 3.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mongo_lambda_backup-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.8 kB
Release files / mongo_lambda_backup-0.3.0.tar.gz
| Download URL | mongo_lambda_backup-0.3.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5201c02a58245ddd33c7adc6980702af5d7aafe029ef085f4de680da44feb232
|
|
BLAKE2b-256 checksum How to use checksums |
0efe94c1dce1e96c554fea4b93cd4eb47523f2918f85ffa1597bc4ef89b1134c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.7
|
Release files / mongo_lambda_backup-0.3.0-py3-none-any.whl
| Download URL | mongo_lambda_backup-0.3.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58e703bc5d264cdf6a8cd93bb056823f54305f242df8645bce0228998673c306
|
|
BLAKE2b-256 checksum How to use checksums |
5b2f18cd47c7c02321f8d932c0e5597c8fb9098ae8984c192f2d221827057838
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.7
|
Security for mongo-lambda-backup 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.