I have RDS which autobackup period is 7 days.
And I have found I can backup the RDS's snapshot to S3 manually.
However I want to make back up RDS snapshot sautomatically to S3.
How can I do this , I should make event bridge?
Best Answer
The first stop for an answer about an AWS service is normally the AWS documentation.Since sometimes finding the right section in the sea of info could be a bit overwhelming, please find below references that should answer your question.There are 3 ways you could export an RDS snapshot to S3:
- Using the management console
- the AWS CLI
- RDS APIs
The Exporting DB snapshot data to Amazon S3 AWS document explains each process in detail.As described in previous comments, you could for instance using a lambda to trigger the RDS APIs.Even more interesting, AWS provide a GitHub repository with the code to automate the export. Please find the code here.
As mentioned in the document, please note that:
Exporting RDS snapshots can take a while depending on your database type and size. The export task first restores and scales the entire database before extracting the data to Amazon S3. The task's progress during this phase displays as Starting. When the task switches to exporting data to S3, progress displays as In progress. The time it takes for the export to complete depends on the data stored in the database. For example, tables with well-distributed numeric primary key or index columns export the fastest. Tables that don't contain a column suitable for partitioning and tables with only one index on a string-based column take longer. This longer export time occurs because the export uses a slower single-threaded process.