{"id":13574282,"url":"https://github.com/cevoaustralia/aws-backup-lambda","last_synced_at":"2026-01-18T09:36:29.405Z","repository":{"id":78264250,"uuid":"74314887","full_name":"cevoaustralia/aws-backup-lambda","owner":"cevoaustralia","description":"A utility AWS lambda function to manage EBS and RDS snapshot backups.","archived":false,"fork":false,"pushed_at":"2018-11-21T20:59:05.000Z","size":33,"stargazers_count":60,"open_issues_count":5,"forks_count":25,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-05T09:44:09.575Z","etag":null,"topics":["aws","aws-lambda","backup","backup-utility","ebs","lambda","lambda-deployment","rds","snapshot"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cevoaustralia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-11-21T01:26:23.000Z","updated_at":"2021-06-23T09:40:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"b04dbbb0-eb52-4c61-93c3-5c7c4837a05a","html_url":"https://github.com/cevoaustralia/aws-backup-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevoaustralia%2Faws-backup-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevoaustralia%2Faws-backup-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevoaustralia%2Faws-backup-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevoaustralia%2Faws-backup-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cevoaustralia","download_url":"https://codeload.github.com/cevoaustralia/aws-backup-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247194238,"owners_count":20899450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","backup","backup-utility","ebs","lambda","lambda-deployment","rds","snapshot"],"created_at":"2024-08-01T15:00:49.620Z","updated_at":"2026-01-18T09:36:29.388Z","avatar_url":"https://github.com/cevoaustralia.png","language":"Python","readme":"aws-backup-lambda\n=================\n\n[![Build Status](https://travis-ci.org/cevoaustralia/aws-backup-lambda.svg?branch=master)](https://travis-ci.org/cevoaustralia/aws-backup-lambda)\n\nA utility AWS lambda function to manage EBS and RDS snapshot backups.\n\n The Lambda function takes new backups when executed, and manages the deletion of the old ones when the upper limit is reached.\n\nThe origin of this project comes from: https://github.com/evannuil/aws-snapshot-tool\n\n## Dependencies\n\nThe tool uses the supplied `boto3` library to connect to the AWS account, and uses the IAM Role defined in the CloudFormation stack to enable access to the required assets.\n\nThe only external dependency is on the `pytz` library for some basic time processing functions.\n\n## Lambda Deployment\n\nTo deploy the lambda code you can run the supplied `upload_lambda.sh` script, or modify it for your purposes.\n\nThe lambda deployment process requires an s3 bucket to store the code before deployment, so before running the script you need create the bucket and export a `BUCKET` environment variable for the script to use.\n\nfor example:\n\n```\nexport REGION=ap-southeast-2\nexport BUCKET=\"lambdabucket1978\"\naws s3 mb s3://${BUCKET} --region ${REGION}\n```\n\nOnce the `BUCKET` and optional `REGION` variables are set, when you run `upload_lambda.sh` it will do the following:\n\n* Use `pip` to install the `pytz` library alongside the python lambda function\n* Use `cloudformation package` to zip up the application and upload to s3\n* As part of the `cloudformation package`, a new `generated-cloudformation.yaml` file will be created with the `CodeUri` pointing at the newly uploaded zip file\n* Invoke a `cloudformation deploy` to execute the creation of a new stack named `aws-backup-lambda`\n\nOnce complete, you should have a new CloudFormation stack, which will have created the Lambda and all required AWS assets\n\n# Configuring the lambda\n\nThe configuration of the lambda is detailed in the `cloudformation.yaml` template file.  \n\nThings you might want to review and change are:\n\n* The frequency of the backups\n* The tags used for the snapshots\n* The date based labels to use for each snapshot\n* The number of snapshots to keep\n* Enable / Disable the EBS or RDS backup function\n\nThe configuration for the Lambda is managed as the `Input` passed to the function from the Scheduled event trigger.\n\nAn example configuration might be:\n\n```\n{\n    \"period_label\": \"day\",\n    \"period_format\": \"%a\",\n    \"keep_count\": 14,\n\n    \"ec2_region_name\": \"ap-southeast-2\",\n    \"rds_region_name\": \"ap-southeast-2\",\n\n    \"tag_name\": \"MakeSnapshot\",\n    \"tag_value\": \"True\"\n}\n```\n\n* `period_label` is used to identify all backups in the same set, ensure this is UNIQUE across each scheduled event\n* `period_format` is the format of the current time to apply to each of the backups, more detail below\n* `keep_count` the number of snapshots to keep for each `period_label`\n* `ec2_region_name` if supplied, EBS volumes for the specified region will be included in the backup run\n* `rds_region_name` if supplied, RDS instances for the specified region will be included in the backup run\n* `tag_name` the RDS and EBS items need to have this tag name to be considered part of the backup\n* `tag_value` the RDS and EBS items need to have this tag value to be considered part of the backup\n\n\n## Supported AWS services\n\nBoth EBS and RDS Snapshot management is supported and enabled by default.\n\nControl of which service is executed is identified by the suppling the region name for the service.\n\n * Supply `ec2_region_name` to run the EBS snapshot process\n * Supply `rds_region_name` to run the RDS snapshot process\n\n*Note:* Currently the backup function only runs against a single region, you could easily add another copy of the function to run against an additional region.\n\n*Note:* For RDS cluster support just add `tag_name`, `tag_value` to one of the instance in the cluster\n\nBoth of these services will use the same field for `tag_name`, `tag_value` and the `keep_count` fields, if you need them to differ then create another Event trigger with different parameters.\n\n\n## Backup label format\n\nThe syntax used to label the backups with a value indicating the current time of the backup.\n\nAny python time format string will be supported, with a set of suggested values shown below.\n\nSuggested settings:\n\n * More often than a day: `%a%H` - show the day of the week and the hour of the day\n * Daily: `%a` - show the day of the week\n * Weekly: `%U` - show the week of the year\n * Monthly: `%b` - show the month\n","funding_links":[],"categories":["Python","AWS Lambda Functions"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcevoaustralia%2Faws-backup-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcevoaustralia%2Faws-backup-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcevoaustralia%2Faws-backup-lambda/lists"}