This repository creates the automation necessary to export Amazon RDS snapshots to S3 for a specific database whenever an automated snapshot is created.
cd
into it.RdsSnapshotExportPipelineStack
constructor in $/bin/cdk.ts
according to your environment.
dbName
: This RDS database must already exist.rdsEventId
: This should be RdsEventId.DB_AUTOMATED_AURORA_SNAPSHOT_CREATED
for Amazon Aurora databases or RdsEventId.DB_AUTOMATED_SNAPSHOT_CREATED
otherwise.s3BucketName
: An S3 bucket with the provided name will be created automatically for you.npm install
npm run cdk bootstrap
npm run cdk deploy
<dbName>-rds-snapshot-exporter
function in the AWS Lambda console and configure a test event using the contents of $/event.json OR $/event.aurora.json as a template, depending on whether or not you're using Amazon Aurora.
<SNAPSHOT_NAME>
value within the Message
key to match an existing RDS snapshot (e.g. rds:<dbName>-YYYY-MM-DD-hh-mm
). You may also need to modify the MessageId
if you are attempting to export the same snapshot more than once.You can check on the progress of the export in the Exports in Amazon S3 listing. When that is finished, you can use the AWS Glue Crawler that was created for you to crawl the export, then use Amazon Athena to perform queries on the exported snapshot.
Execute npm run cdk destroy
to delete resources pertaining to this example.
You will also need to delete the following manually:
npm run cdk bootstrap
.cdktoolkit-stagingbucket-<...>
bucket.This library is licensed under the MIT-0 License. See the LICENSE file.