AWS Backup is a managed service by AWS, that helps application developers leverage the AWS Cloud to automate the boring job of running regular backup tasks for their persistent data, monitoring existing backups, and cleanup older copies of backups as they are no longer needed.
Like other “horizontal” services like IAM and CloudWatch, AWS Backup integrates pretty well with a variety of other AWS services, out of the box. Such services include (as of writing):
With the help of Infrastructure as Code in general, and AWS CDK specifically – one can easily configure AWS Backup for the whole infrastructure of an application and never have to think about backups stuff that stores data persistently anymore (like databases).
Here’s an example of a trivia CDK app that is composed of multiple CloudFormation stacks that potentially might themselves include many many DynamoDB tables, S3 buckets, EFS volumes, etc (basically any of the resources described in the list above).
The way to easily plug AWS Backup in the setup above is to first create a dedicated CloudFormation stack for the Backup Plan itself (Backup Plans are a concept within the AWS Backup service).
Then you can use the addSelection()
method of the BackupPlan construct to easily add one or more supported resources that will be automatically backed up by AWS Backup (including whole CDK Stacks or a whole CDK app, like the example below).
This has been a quick introduction to AWS Backups and the Backup Plans and how they are used in the AWS CDK context. Hope you found it useful.
Looking forward to your feedback in the comments below.