AWS Backup is a fully managed backup service that makes it easy to centralize and automate the backup of data across AWS services.
Using AWS Backup, you can centrally configure backup policies and monitor backup activity for AWS resources, such as Amazon EBS volumes, Amazon EC2 instances, Amazon RDS databases, Amazon DynamoDB tables, Amazon EFS file systems, Amazon FSx file systems, and AWS Storage Gateway volumes.
This article gives an example of how to create backup plans for volumes (root and mount) of multiple instances using AWS CDK based on Tags. For example,
Tags vc:aws-volume:kind - ebs-ddb
Any volumes with this tag within a region will be included in the backup plans resource assignment.
2. Resource assignments
1. To get familiar with CDK, go to Your first AWS CDK app
2. Create cdk-aws-backup project
mkdir cdk-aws-backup cd cdk-aws-backup cdk init -l python
3. Create stacks through code
- Stacks: https://github.com/vumdao/cdk-aws-backup/blob/master/aws_backup/aws_backup_stack.py
- app: https://github.com/vumdao/cdk-aws-backup/blob/master/app.py
4. Tag the resources using bash script
- The script will loop all instances with name *-ddb-instance and then tag volumes of the instance as
5. Run cdk deploy to create stack
Note: This post does not show the output of running cdk deploy because it contain AWS account information, leave comments here if there's any issue or need support