Skip to main content

cdk-rds-dump

cdk-rds-dump is a Constructs library for AWS CDK that provides the functionality to dump the contents of Amazon RDS, generate it as an SQL file, and store it in Amazon S3.

Architecture

View on Construct Hub Open in Visual Studio Code npm version Build Status Release Status License npm downloads

Usage

Install from npm:

npm i cdk-rds-dump

Then write CDK code as below:

import * as events from 'aws-cdk-lib/aws-events'
import { RdsDump, DbEngine } from 'cdk-rds-dump';

declare const rdsCluster: rds.DatabaseCluster;
new RdsDump(this, "RdsDump", {
  dbEngine: DbEngine.MYSQL,
  rdsCluster: cluster,
  databaseName: "testDatabase",
  schedule: events.Schedule.cron({ minute: "0", hour: "0" }),
  // optional
  lambdaEnv: {
    ENV_VAR: "value",
  },
  // optional
  createSecretsManagerVPCEndpoint: false,
  // DB secret is obtained from rdsCluster.secret as default.
  // If you want to use a different secret, you can specify it as follows.
  // secretId: 'secretsmanager-secret-id',
});

Note: Assuming access to S3 via a Gateway Endpoint from within a VPC, please configure the Gateway Endpoint and update the Route Table based on this.

// Add gateway endpoints when creating the VPC
  const vpc = new ec2.Vpc(this, 'MyVpc', {
    gatewayEndpoints: {
      S3: {
        service: ec2.GatewayVpcEndpointAwsService.S3,
      },
    },
  });

How does it work?

This code creates a new RDS cluster and uses the RdsDump Construct to dump the data from that RDS cluster. The dumped data is generated as an SQL file and stored in Amazon S3.

For detailed usage and details of the parameters, refer to the API documentation.

Why do we need this construct?

AWS RDS is a very useful managed RDB service and includes, by default, the ability to create snapshots. However, in some cases, such as for development reasons, it is easier to handle SQL files dumped from the DB. Therefore, cdk-rds-dump was created as a construct to easily create SQL files on a regular basis.

Contribution

Contributions to the project are welcome. Submit improvement proposals via pull requests or propose new features.

License

This project is licensed under the Apache-2.0 License.

Metadata

Release files for cdk-rds-dump 2.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdk-rds-dump 2.1.13
File Size Uploaded Provenance Actions
cdk_rds_dump-2.1.13.tar.gz 3.2 MB Without provenance Details for cdk_rds_dump-2.1.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdk-rds-dump 2.1.13
File Interpreter ABI Platform Actions
cdk_rds_dump-2.1.13-py3-none-any.whl Python 3 none any Details for cdk_rds_dump-2.1.13-py3-none-any.whl

Total release size: 6.3 MB

Release files / cdk_rds_dump-2.1.13.tar.gz

Download URL cdk_rds_dump-2.1.13.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
dea95062380dbfac49d593f4c46963d096834ab0e453a818d8b5192ca364b765
BLAKE2b-256 checksum
How to use checksums
be0934607f34c14dbe1628c43f8d282577a918411cca31433a52201503fccad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.14.7

Release files / cdk_rds_dump-2.1.13-py3-none-any.whl

Download URL cdk_rds_dump-2.1.13-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
95159899a582d9f0976997d4b0bfb07cafff5b072fa7597cff0a4e3648cda8c2
BLAKE2b-256 checksum
How to use checksums
b9c133eb12659dcf0d355fa4aad82d72edfad011a1cfee9453726fb2e51f393a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.14.7

Security for cdk-rds-dump 2.1.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.13 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page