Create an AWS Lambda to backup MySQL databases into a S3 bucket.
- Create a Lambda function with any Python version as runtime
- Make sure to assign a permission that allows files to be inserted into S3
- Create a Layer with
mysqldump5.7-cli.zip
- Paste the code from
lambda_function.py
into your Lambda - Setup your Environment Variables
- Done!
HOST
: from your MySQL databasePORT
: from your MySQL databaseDATABASE_NAME
: from your MySQL databasePASSWORD
: from your MySQL databaseBUCKET_NAME
: from your S3BUCKET_FOLDER
: from your S3