Oleksandr
Oleksandr

Reputation: 293

AWS Elastic Beanstalk (AWS EB) Backup - best practice

What are the best practices, please to backup AWS EB prod environment including the database? I have dynamic instances configuration and source code is stored elsewhere, so loosing an EC2 isn't a problem. What I need to backup is;

  1. AWS EB Environment configuration (with deployed package?)
  2. AWS EB Environment Database and being able to restore it
  3. Connected files storage on S3 bucket

Upvotes: 5

Views: 3574

Answers (1)

Marcin
Marcin

Reputation: 238189

EB environment

The EB config files can be bundled with your application source code, e.g. .ebextenations, platform deployment hooks, env.yaml. So all the config files provided with your application are backed by backing up your source code.

Depending on your setup, you can have also saved configurations. These are not bundled with your source code. When you create a saved configuration, it is stored in EB S3 bucket. So if you want to backup these configurations outside of the S3, you have to download them and store separately.

But the easiest way to backup those saved configurations and your deployed application zip files, would be to enable versioning on the EB created bucket. By default, the versioning is disabled. Once enabled, it protects you from accidental deletions and also gives you ability to look back at previous versions of the files in the EB bucket.

If the content of the S3 bucket is critical, you can setup automated replication of it to different region for safe keeping in case of region-level disaster.

Database

Database created by EB console is provided by a AWS RDS. Thus, you can use rich portfolio of methods to backup it. Depending on the level of how critical the database is you have a number of choices:

  • automated backups done by AWS daily.
  • manual backups done by you when ever you want.
  • copying backups to different region
  • setting multi-AZ deployment for high availability and failure resistance.
  • creating read replicas, in different region for disaster recovery.
  • using db-native tools (e.g. mysqldump) for dumping the content of your

Depending on your choices of backup technique, the cost will vary. The free backups are automated backups. For everything else you have to pay extra.

External database

I already mentioned in the comments that it is not a good practice to bundle db with your EB environment. If you already have this, and would like to separate them, AWS provides a guide on how to de-couple rds from EB:

Upvotes: 7

Related Questions