Backup MongoDB databases using AWS Lambda functions
Project description
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_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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mongo_lambda_backup-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7bc2bf7d2abe385fb72e6602a23d97cfb949856e145e32637bcbb3d1b93f343 |
|
MD5 | 83f694a3331fba57448f58e50aa9f1fd |
|
BLAKE2b-256 | c09e2beee652f2505fc97b1d3e0d8a0246d3e98a2198933ad945e57103d45bc4 |
Close
Hashes for mongo_lambda_backup-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4693f5bf869e6b64471e6082dcb81d8160bd5ba9e0cab9d0f85ead1ab72ae36 |
|
MD5 | 67e1e7e9843858d56c8e021eeabb967b |
|
BLAKE2b-256 | 8239969acdfa73a2afa50f9abc2d18bee4295ca1e5c7ce2e2f25da2f631df60f |