-1

I want to backup all resources from VPC. Currently, I am doing something like this via a python script,

  • Back up individual resources like EC2, RDS, EFS, etc from VPC.

I am just wondering if we could back up the entire VPC at once instead of backing up all resources separately using the python programming language.

YASH JADHAV
  • 143
  • 2
  • 11
  • You cannot backup everything at once. Through Python you can invoke backups/snapshots for each resource you have there. Better option for you would be to start using AWS Backup service, where you can create rules based on different parameters and it can easily create backups for all of your resources – Caldazar Feb 18 '22 at 08:58

1 Answers1

5

There isn't really the concept of "backups" in AWS (aside from storage services).

A preferred approach is to deploy "infrastructure as code", which means using an Amazon CloudFormation template to deploy infrastructure, with the ability to redeploy the infrastructure again using the same template. So, it's more "re-deployable" rather than "backup".

There is no simple "Backup this VPC" button. Rather, you would need to consider each service individually to determine how to backup or create a template to enable redeployment.

Storage services that provide 'backup' capabilities include:

  • You can create an Amazon Machine Image (AMI) from an Amazon EC2 instance, which allows a new instance to be launched with the same disk contents
  • You can create a Snapshot of an Amazon EBS Volume, which allows a new Volume to be created with an identical copy of the data
  • You can create a Snapshot of an Amazon RDS database, which allows a new database to be launched with an identical copy of the data
  • You can Use AWS Backup to back up and restore Amazon EFS file systems

You can certainly use Python and boto3 to make API calls to AWS, which can create, inspect and delete resources. It can also trigger the creation of the snapshots and AWS mentioned above. However, there is no simple "backup everything" API call.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470