Reputation: 293
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;
Upvotes: 5
Views: 3574
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:
mysqldump
) for dumping the content of yourDepending 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