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 of the MongoDB host to be backed up.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).
License
MIT © Frederik Ring
Metadata
Release files for mongo-lambda-backup 0.2.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 | |
|---|---|---|---|
| mongo_lambda_backup-0.2.0.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mongo_lambda_backup-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.2 kB
Release files / mongo_lambda_backup-0.2.0.tar.gz
| Download URL | mongo_lambda_backup-0.2.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3f3ec69410b2f2558ef54f10edeb79ef5d118a69c75d892bc26e53579c9336a
|
|
BLAKE2b-256 checksum How to use checksums |
1aad476803cedaa98f2782b5144cf4af5a838301162bae0cab06d12550dd0f82
|
| 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.2.0-py3-none-any.whl
| Download URL | mongo_lambda_backup-0.2.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1caf9020f8dd67d80adeaf5a092d732fe2cfec5fce832d83e34a26b0a061a693
|
|
BLAKE2b-256 checksum How to use checksums |
d86e223a3ee9cb8d464f4c12656b0a22130ad9be636ece63238e06dc0ca5870d
|
| 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
|