Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconaurora
file-type-iconefs
file-type-iconlambda-cleanup-snapshots
file-type-iconlambda-copy-shared-snapshot
file-type-iconlambda-create-snapshot
file-type-iconcreate-rds-snapshot
file-type-iconREADME.adoc
file-type-iconcore-concepts.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-iconlambda-share-snapshot
file-type-iconrds
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.adoc

Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconaurora
file-type-iconefs
file-type-iconlambda-cleanup-snapshots
file-type-iconlambda-copy-shared-snapshot
file-type-iconlambda-create-snapshot
file-type-iconcreate-rds-snapshot
file-type-iconREADME.adoc
file-type-iconcore-concepts.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-iconlambda-share-snapshot
file-type-iconrds
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.adoc
Database backup

Database backup

Snapshot your RDS databases and copy the snapshots to other AWS accounts on a scheduled basis for disaster recovery.

Code Preview

Preview the Code

mobile file icon

README.adoc

down

maintained%20by gruntwork.io %235849a6 Terraform version

This module, along with the lambda-share-snapshot and lambda-copy-shared-snapshot modules, can be used to backup your RDS database to another AWS account (e.g., for disaster recovery) on a configurable schedule. Under the hood, each module runs a Lambda function that instructs your database to take a snapshot (this module), share the snapshot with another account (the lambda-share-snapshot module), and make a copy of the snapshot (lambda-copy-shared-snapshot).

RDS architecture

Features

  • Standalone functions for taking snapshots, sharing snapshots, and copying snapshots that can be combined in many different ways

  • You can combine them to copy snapshots across AWS accounts and regions

  • Configurable backup schedule (e.g., using cron expressions)

  • Clean up old snapshots automatically using the lambda-cleanup-snapshots module.

Learn

Note
This repo is a part of the Gruntwork Infrastructure as Code Library, a collection of reusable, battle-tested, production ready infrastructure code. If you’ve never used the Infrastructure as Code Library before, make sure to read How to use the Gruntwork Infrastructure as Code Library!

Core concepts

Repo organization

  • modules: the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules.

    • modules/rds: use this module to deploy all non-Amazon databases, including MySQL, PostgreSQL, MariaDB, Oracle, and SQL Server.

    • modules/aurora: use this module to deploy all Amazon’s Aurora and Aurora Serverless databases.

    • modules/lambda-create-snapshot: use this module and the other lambda-xxx-snapshot modules to create custom snapshots of your databases and copy those snapshots to other AWS accounts.

  • examples: This folder contains working examples of how to use the submodules.

  • test: Automated tests for the modules and examples.

Deploy

Non-production deployment (quick start for learning)

If you just want to try this repo out for experimenting and learning, check out the following resources:

  • examples folder: The examples folder contains sample code optimized for learning, experimenting, and testing (but not production usage).

Production deployment

If you want to deploy this repo in production, check out the following resources:

Support

If you need help with this repo or anything else related to infrastructure or DevOps, Gruntwork offers Commercial Support via Slack, email, and phone/video. If you’re already a Gruntwork customer, hop on Slack and ask away! If not, subscribe now. If you’re not sure, feel free to email us at support@gruntwork.io.

Contributions

Contributions to this repo are very welcome and appreciated! If you find a bug or want to add a new feature or even contribute an entirely new module, we are very happy to accept pull requests, provide feedback, and run your changes through our automated test suite.

License

Please see LICENSE.txt for details on how the code in this repo is licensed.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?