Skip to main content

A construct for working with RDS SQL servers

Project description

RDS Tools

---

cdk-constructs: Developer Preview

The APIs of higher level constructs in this module are in developer preview before they become stable. We will only make breaking changes to address unforeseen API issues. Therefore, these APIs are not subject to Semantic Versioning, and breaking changes will be announced in release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


There are multiple versions of this library published. You should be using the v0.X.X versions for now. There are versions published that match the CDK version they depend on, but don't use those.

This is a collection of CDK constructs you can use with RDS.

Developer Preview

DatabaseScript

Provides a Custom Resource and backing Lambda Function that will run a given script against a given database.

const databaseInstance = new DatabaseInstance(stack, 'test-database', {
  engine: DatabaseInstanceEngine.sqlServerWeb({ version: SqlServerEngineVersion.VER_15_00_4043_16_V1 }),
  vpc: vpc,
});


const databaseScript = new DatabaseScript(stack2, 'test', {
  databaseInstance,
  script: 'SELECT 1',
})

// Allow the script to connect to the database
databaseInstance.connections.allowDefaultPortFrom(databaseScript);

// Make sure the script runs after the database is created
databaseScript.node.addDependency(databaseInstance);

DatabaseUser

There was once a construct called DatabaseUser. However, it is better to use the standard code from the CDK directly:

const myUserSecret = new rds.DatabaseSecret(this, 'MyUserSecret', {
  username: 'myuser',
  masterSecret: instance.secret,
  excludeCharacters: '{}[]()\'"/\\', // defaults to the set " %+~`#$&*()|[]{}:;<>?!'/@\"\\"
});
const myUserSecretAttached = myUserSecret.attach(instance); // Adds DB connections information in the secret
instance.addRotationMultiUser('MyUser', { // Add rotation using the multi user scheme
  secret: myUserSecretAttached,
});

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mbonig_rds_tools-2.1.0.tar.gz (21.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mbonig_rds_tools-2.1.0-py3-none-any.whl (21.9 MB view details)

Uploaded Python 3

File details

Details for the file mbonig_rds_tools-2.1.0.tar.gz.

File metadata

  • Download URL: mbonig_rds_tools-2.1.0.tar.gz
  • Upload date:
  • Size: 21.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mbonig_rds_tools-2.1.0.tar.gz
Algorithm Hash digest
SHA256 8318ec7ebb1369cc808d426d373254c7b2c2e8e080ed78344c7fcacbdc3220d7
MD5 9088cf4391c8d34c224888a2a1358036
BLAKE2b-256 14b64e28c989b4131488db1aeb0bff68be5f52e2cc0decc85aa2c905c4964377

See more details on using hashes here.

File details

Details for the file mbonig_rds_tools-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mbonig_rds_tools-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5089fa43c14dcb161460b821b9aecedb7e4b306fb96a88cd94f59e14d6da3e9
MD5 528262dd835266cb9a82d3332665e8c7
BLAKE2b-256 450cc34e2084e93bc07e294d4b08e68e037367ef8b4fe8d3af2d3e17c8219213

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page