Show / Hide Table of Contents

Namespace Amazon.CDK.AWS.RDS

Amazon Relational Database Service Construct Library

--- cfn-resources: Stable cdk-constructs: Stable
using Amazon.CDK.AWS.RDS;

Starting a clustered database

To set up a clustered database (like Aurora), define a DatabaseCluster. You must always launch a database in a VPC. Use the vpcSubnets attribute to control whether your instances will be launched privately or publicly:

Vpc vpc;

DatabaseCluster cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
    Engine = DatabaseClusterEngine.AuroraMysql(new AuroraMysqlClusterEngineProps { Version = AuroraMysqlEngineVersion.VER_2_08_1 }),
    Credentials = Credentials.FromGeneratedSecret("clusteradmin"),  // Optional - will default to 'admin' username and generated password
    InstanceProps = new InstanceProps {
        // optional , defaults to t3.medium
        InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.SMALL),
        VpcSubnets = new SubnetSelection {
            SubnetType = SubnetType.PRIVATE_WITH_NAT
        },
        Vpc = vpc
    }
});

If there isn't a constant for the exact version you want to use, all of the Version classes have a static of method that can be used to create an arbitrary version.

AuroraMysqlEngineVersion customEngineVersion = AuroraMysqlEngineVersion.Of("5.7.mysql_aurora.2.08.1");

By default, the master password will be generated and stored in AWS Secrets Manager with auto-generated description.

Your cluster will be empty by default. To add a default database upon construction, specify the defaultDatabaseName attribute.

Use DatabaseClusterFromSnapshot to create a cluster from a snapshot:

Vpc vpc;

new DatabaseClusterFromSnapshot(this, "Database", new DatabaseClusterFromSnapshotProps {
    Engine = DatabaseClusterEngine.Aurora(new AuroraClusterEngineProps { Version = AuroraEngineVersion.VER_1_22_2 }),
    InstanceProps = new InstanceProps {
        Vpc = vpc
    },
    SnapshotIdentifier = "mySnapshot"
});

Starting an instance database

To set up a instance database, define a DatabaseInstance. You must always launch a database in a VPC. Use the vpcSubnets attribute to control whether your instances will be launched privately or publicly:

Vpc vpc;

DatabaseInstance instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    // optional, defaults to m5.large
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.SMALL),
    Credentials = Credentials.FromGeneratedSecret("syscdk"),  // Optional - will default to 'admin' username and generated password
    Vpc = vpc,
    VpcSubnets = new SubnetSelection {
        SubnetType = SubnetType.PRIVATE_WITH_NAT
    }
});

If there isn't a constant for the exact engine version you want to use, all of the Version classes have a static of method that can be used to create an arbitrary version.

OracleEngineVersion customEngineVersion = OracleEngineVersion.Of("19.0.0.0.ru-2020-04.rur-2020-04.r1", "19");

By default, the master password will be generated and stored in AWS Secrets Manager.

To use the storage auto scaling option of RDS you can specify the maximum allocated storage. This is the upper limit to which RDS can automatically scale the storage. More info can be found here Example for max storage configuration:

Vpc vpc;

DatabaseInstance instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_12_3 }),
    // optional, defaults to m5.large
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.SMALL),
    Vpc = vpc,
    MaxAllocatedStorage = 200
});

Use DatabaseInstanceFromSnapshot and DatabaseInstanceReadReplica to create an instance from snapshot or a source database respectively:

Vpc vpc;

DatabaseInstance sourceInstance;

new DatabaseInstanceFromSnapshot(this, "Instance", new DatabaseInstanceFromSnapshotProps {
    SnapshotIdentifier = "my-snapshot",
    Engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_12_3 }),
    // optional, defaults to m5.large
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.LARGE),
    Vpc = vpc
});
new DatabaseInstanceReadReplica(this, "ReadReplica", new DatabaseInstanceReadReplicaProps {
    SourceDatabaseInstance = sourceInstance,
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.LARGE),
    Vpc = vpc
});

Automatic backups of read replica instances are only supported for MySQL and MariaDB. By default, automatic backups are disabled for read replicas and can only be enabled (using backupRetention) if also enabled on the source instance.

Creating a "production" Oracle database instance with option and parameter groups:

// Set open cursors with parameter group
ParameterGroup parameterGroup = new ParameterGroup(this, "ParameterGroup", new ParameterGroupProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    Parameters = new Dictionary<string, string> {
        { "open_cursors", "2500" }
    }
});

OptionGroup optionGroup = new OptionGroup(this, "OptionGroup", new OptionGroupProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    Configurations = new [] { new OptionConfiguration {
        Name = "LOCATOR"
    }, new OptionConfiguration {
        Name = "OEM",
        Port = 1158,
        Vpc = vpc
    } }
});

// Allow connections to OEM
optionGroup.OptionConnections.OEM.Connections.AllowDefaultPortFromAnyIpv4();

// Database instance with production values
DatabaseInstance instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    LicenseModel = LicenseModel.BRING_YOUR_OWN_LICENSE,
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.MEDIUM),
    MultiAz = true,
    StorageType = StorageType.IO1,
    Credentials = Credentials.FromUsername("syscdk"),
    Vpc = vpc,
    DatabaseName = "ORCL",
    StorageEncrypted = true,
    BackupRetention = Duration.Days(7),
    MonitoringInterval = Duration.Seconds(60),
    EnablePerformanceInsights = true,
    CloudwatchLogsExports = new [] { "trace", "audit", "alert", "listener" },
    CloudwatchLogsRetention = RetentionDays.ONE_MONTH,
    AutoMinorVersionUpgrade = true,  // required to be true if LOCATOR is used in the option group
    OptionGroup = optionGroup,
    ParameterGroup = parameterGroup,
    RemovalPolicy = RemovalPolicy.DESTROY
});

// Allow connections on default port from any IPV4
instance.Connections.AllowDefaultPortFromAnyIpv4();

// Rotate the master user password every 30 days
instance.AddRotationSingleUser();

// Add alarm for high CPU
// Add alarm for high CPU
new Alarm(this, "HighCPU", new AlarmProps {
    Metric = instance.MetricCPUUtilization(),
    Threshold = 90,
    EvaluationPeriods = 1
});

// Trigger Lambda function on instance availability events
Function fn = new Function(this, "Function", new FunctionProps {
    Code = Code.FromInline("exports.handler = (event) => console.log(event);"),
    Handler = "index.handler",
    Runtime = Runtime.NODEJS_14_X
});

Rule availabilityRule = instance.OnEvent("Availability", new OnEventOptions { Target = new LambdaFunction(fn) });
availabilityRule.AddEventPattern(new EventPattern {
    Detail = new Dictionary<string, object> {
        { "EventCategories", new [] { "availability" } }
    }
});

Add XMLDB and OEM with option group

// Set open cursors with parameter group
ParameterGroup parameterGroup = new ParameterGroup(this, "ParameterGroup", new ParameterGroupProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    Parameters = new Dictionary<string, string> {
        { "open_cursors", "2500" }
    }
});

OptionGroup optionGroup = new OptionGroup(this, "OptionGroup", new OptionGroupProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    Configurations = new [] { new OptionConfiguration {
        Name = "LOCATOR"
    }, new OptionConfiguration {
        Name = "OEM",
        Port = 1158,
        Vpc = vpc
    } }
});

// Allow connections to OEM
optionGroup.OptionConnections.OEM.Connections.AllowDefaultPortFromAnyIpv4();

// Database instance with production values
DatabaseInstance instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    LicenseModel = LicenseModel.BRING_YOUR_OWN_LICENSE,
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.MEDIUM),
    MultiAz = true,
    StorageType = StorageType.IO1,
    Credentials = Credentials.FromUsername("syscdk"),
    Vpc = vpc,
    DatabaseName = "ORCL",
    StorageEncrypted = true,
    BackupRetention = Duration.Days(7),
    MonitoringInterval = Duration.Seconds(60),
    EnablePerformanceInsights = true,
    CloudwatchLogsExports = new [] { "trace", "audit", "alert", "listener" },
    CloudwatchLogsRetention = RetentionDays.ONE_MONTH,
    AutoMinorVersionUpgrade = true,  // required to be true if LOCATOR is used in the option group
    OptionGroup = optionGroup,
    ParameterGroup = parameterGroup,
    RemovalPolicy = RemovalPolicy.DESTROY
});

// Allow connections on default port from any IPV4
instance.Connections.AllowDefaultPortFromAnyIpv4();

// Rotate the master user password every 30 days
instance.AddRotationSingleUser();

// Add alarm for high CPU
// Add alarm for high CPU
new Alarm(this, "HighCPU", new AlarmProps {
    Metric = instance.MetricCPUUtilization(),
    Threshold = 90,
    EvaluationPeriods = 1
});

// Trigger Lambda function on instance availability events
Function fn = new Function(this, "Function", new FunctionProps {
    Code = Code.FromInline("exports.handler = (event) => console.log(event);"),
    Handler = "index.handler",
    Runtime = Runtime.NODEJS_14_X
});

Rule availabilityRule = instance.OnEvent("Availability", new OnEventOptions { Target = new LambdaFunction(fn) });
availabilityRule.AddEventPattern(new EventPattern {
    Detail = new Dictionary<string, object> {
        { "EventCategories", new [] { "availability" } }
    }
});

Setting Public Accessibility

You can set public accessibility for the database instance or cluster using the publiclyAccessible property. If you specify true, it creates an instance with a publicly resolvable DNS name, which resolves to a public IP address. If you specify false, it creates an internal instance with a DNS name that resolves to a private IP address. The default value depends on vpcSubnets. It will be true if vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise.

Vpc vpc;

// Setting public accessibility for DB instance
// Setting public accessibility for DB instance
new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.Mysql(new MySqlInstanceEngineProps {
        Version = MysqlEngineVersion.VER_8_0_19
    }),
    Vpc = vpc,
    VpcSubnets = new SubnetSelection {
        SubnetType = SubnetType.PRIVATE_WITH_NAT
    },
    PubliclyAccessible = true
});

// Setting public accessibility for DB cluster
// Setting public accessibility for DB cluster
new DatabaseCluster(this, "DatabaseCluster", new DatabaseClusterProps {
    Engine = DatabaseClusterEngine.AURORA,
    InstanceProps = new InstanceProps {
        Vpc = vpc,
        VpcSubnets = new SubnetSelection {
            SubnetType = SubnetType.PRIVATE_WITH_NAT
        },
        PubliclyAccessible = true
    }
});

Instance events

To define Amazon CloudWatch event rules for database instances, use the onEvent method:

DatabaseInstance instance;
Function fn;

Rule rule = instance.OnEvent("InstanceEvent", new OnEventOptions { Target = new LambdaFunction(fn) });

Login credentials

By default, database instances and clusters (with the exception of DatabaseInstanceFromSnapshot and ServerlessClusterFromSnapshot) will have admin user with an auto-generated password. An alternative username (and password) may be specified for the admin user instead of the default.

The following examples use a DatabaseInstance, but the same usage is applicable to DatabaseCluster.

Vpc vpc;

IInstanceEngine engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_12_3 });
new DatabaseInstance(this, "InstanceWithUsername", new DatabaseInstanceProps {
    Engine = engine,
    Vpc = vpc,
    Credentials = Credentials.FromGeneratedSecret("postgres")
});

new DatabaseInstance(this, "InstanceWithUsernameAndPassword", new DatabaseInstanceProps {
    Engine = engine,
    Vpc = vpc,
    Credentials = Credentials.FromPassword("postgres", SecretValue.SsmSecure("/dbPassword", "1"))
});

ISecret mySecret = Secret.FromSecretName(this, "DBSecret", "myDBLoginInfo");
new DatabaseInstance(this, "InstanceWithSecretLogin", new DatabaseInstanceProps {
    Engine = engine,
    Vpc = vpc,
    Credentials = Credentials.FromSecret(mySecret)
});

Secrets generated by fromGeneratedSecret() can be customized:

Vpc vpc;

IInstanceEngine engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_12_3 });
Key myKey = new Key(this, "MyKey");

new DatabaseInstance(this, "InstanceWithCustomizedSecret", new DatabaseInstanceProps {
    Engine = engine,
    Vpc = vpc,
    Credentials = Credentials.FromGeneratedSecret("postgres", new CredentialsBaseOptions {
        SecretName = "my-cool-name",
        EncryptionKey = myKey,
        ExcludeCharacters = "!&*^#@()",
        ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
    })
});

Snapshot credentials

As noted above, Databases created with DatabaseInstanceFromSnapshot or ServerlessClusterFromSnapshot will not create user and auto-generated password by default because it's not possible to change the master username for a snapshot. Instead, they will use the existing username and password from the snapshot. You can still generate a new password - to generate a secret similarly to the other constructs, pass in credentials with fromGeneratedSecret() or fromGeneratedPassword().

Vpc vpc;

IInstanceEngine engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_12_3 });
Key myKey = new Key(this, "MyKey");

new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
    Engine = engine,
    Vpc = vpc,
    SnapshotIdentifier = "mySnapshot",
    Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
        EncryptionKey = myKey,
        ExcludeCharacters = "!&*^#@()",
        ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
    })
});

Connecting

To control who can access the cluster or instance, use the .connections attribute. RDS databases have a default port, so you don't need to specify the port:

DatabaseCluster cluster;

cluster.Connections.AllowFromAnyIpv4(Port.AllTraffic(), "Open to the world");

The endpoints to access your database cluster will be available as the .clusterEndpoint and .readerEndpoint attributes:

DatabaseCluster cluster;

string writeAddress = cluster.ClusterEndpoint.SocketAddress;

For an instance database:

DatabaseInstance instance;

string address = instance.InstanceEndpoint.SocketAddress;

Rotating credentials

When the master password is generated and stored in AWS Secrets Manager, it can be rotated automatically:

using Amazon.CDK;

DatabaseInstance instance;
instance.AddRotationSingleUser(new RotationSingleUserOptions {
    AutomaticallyAfter = Duration.Days(7),  // defaults to 30 days
    ExcludeCharacters = "!@#$%^&*"
});
DatabaseCluster cluster = new DatabaseCluster(stack, "Database", new DatabaseClusterProps {
    Engine = DatabaseClusterEngine.AURORA,
    InstanceProps = new InstanceProps {
        InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.SMALL),
        Vpc = vpc
    }
});

cluster.AddRotationSingleUser();

The multi user rotation scheme is also available:

DatabaseInstance instance;
DatabaseSecret myImportedSecret;

instance.AddRotationMultiUser("MyUser", new RotationMultiUserOptions {
    Secret = myImportedSecret
});

It's also possible to create user credentials together with the instance/cluster and add rotation:

DatabaseInstance instance;

DatabaseSecret myUserSecret = new DatabaseSecret(this, "MyUserSecret", new DatabaseSecretProps {
    Username = "myuser",
    SecretName = "my-user-secret",  // optional, defaults to a CloudFormation-generated name
    MasterSecret = instance.Secret,
    ExcludeCharacters = "{}[]()'\"/\\"
});
ISecret myUserSecretAttached = myUserSecret.Attach(instance); // Adds DB connections information in the secret

instance.AddRotationMultiUser("MyUser", new RotationMultiUserOptions {  // Add rotation using the multi user scheme
    Secret = myUserSecretAttached });

Note: This user must be created manually in the database using the master credentials. The rotation will start as soon as this user exists.

Access to the Secrets Manager API is required for the secret rotation. This can be achieved either with internet connectivity (through NAT) or with a VPC interface endpoint. By default, the rotation Lambda function is deployed in the same subnets as the instance/cluster. If access to the Secrets Manager API is not possible from those subnets or using the default API endpoint, use the vpcSubnets and/or endpoint options:

DatabaseInstance instance;
InterfaceVpcEndpoint myEndpoint;


instance.AddRotationSingleUser(new RotationSingleUserOptions {
    VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PRIVATE_WITH_NAT },  // Place rotation Lambda in private subnets
    Endpoint = myEndpoint
});

See also @aws-cdk/aws-secretsmanager for credentials rotation of existing clusters/instances.

IAM Authentication

You can also authenticate to a database instance using AWS Identity and Access Management (IAM) database authentication; See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html for more information and a list of supported versions and limitations.

Note: grantConnect() does not currently work - see this GitHub issue.

The following example shows enabling IAM authentication for a database instance and granting connection access to an IAM role.

Vpc vpc;

DatabaseInstance instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.Mysql(new MySqlInstanceEngineProps { Version = MysqlEngineVersion.VER_8_0_19 }),
    Vpc = vpc,
    IamAuthentication = true
});
Role role = new Role(this, "DBRole", new RoleProps { AssumedBy = new AccountPrincipal(Account) });
instance.GrantConnect(role);

The following example shows granting connection access for RDS Proxy to an IAM role.

Vpc vpc;

DatabaseCluster cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
    Engine = DatabaseClusterEngine.AURORA,
    InstanceProps = new InstanceProps { Vpc = vpc }
});

DatabaseProxy proxy = new DatabaseProxy(this, "Proxy", new DatabaseProxyProps {
    ProxyTarget = ProxyTarget.FromCluster(cluster),
    Secrets = new [] { cluster.Secret },
    Vpc = vpc
});

Role role = new Role(this, "DBProxyRole", new RoleProps { AssumedBy = new AccountPrincipal(Account) });
proxy.GrantConnect(role, "admin");

Note: In addition to the setup above, a database user will need to be created to support IAM auth. See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html for setup instructions.

Kerberos Authentication

You can also authenticate using Kerberos to a database instance using AWS Managed Microsoft AD for authentication; See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html for more information and a list of supported versions and limitations.

The following example shows enabling domain support for a database instance and creating an IAM role to access Directory Services.

Vpc vpc;

Role role = new Role(this, "RDSDirectoryServicesRole", new RoleProps {
    AssumedBy = new ServicePrincipal("rds.amazonaws.com"),
    ManagedPolicies = new [] { ManagedPolicy.FromAwsManagedPolicyName("service-role/AmazonRDSDirectoryServiceAccess") }
});
DatabaseInstance instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.Mysql(new MySqlInstanceEngineProps { Version = MysqlEngineVersion.VER_8_0_19 }),
    Vpc = vpc,
    Domain = "d-????????",  // The ID of the domain for the instance to join.
    DomainRole = role
});

Note: In addition to the setup above, you need to make sure that the database instance has network connectivity to the domain controllers. This includes enabling cross-VPC traffic if in a different VPC and setting up the appropriate security groups/network ACL to allow traffic between the database instance and domain controllers. Once configured, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html for details on configuring users for each available database engine.

Metrics

Database instances and clusters both expose metrics (cloudwatch.Metric):

// The number of database connections in use (average over 5 minutes)
DatabaseInstance instance;

// Average CPU utilization over 5 minutes
DatabaseCluster cluster;

Metric dbConnections = instance.MetricDatabaseConnections();
Metric cpuUtilization = cluster.MetricCPUUtilization();

// The average amount of time taken per disk I/O operation (average over 1 minute)
Metric readLatency = instance.Metric("ReadLatency", new MetricOptions { Statistic = "Average", Period = Duration.Seconds(60) });

Enabling S3 integration

Data in S3 buckets can be imported to and exported from certain database engines using SQL queries. To enable this functionality, set the s3ImportBuckets and s3ExportBuckets properties for import and export respectively. When configured, the CDK automatically creates and configures IAM roles as required. Additionally, the s3ImportRole and s3ExportRole properties can be used to set this role directly.

You can read more about loading data to (or from) S3 here:

    The following snippet sets up a database cluster with different S3 buckets where the data is imported and exported -

    using Amazon.CDK.AWS.S3;
    
    Vpc vpc;
    
    Bucket importBucket = new Bucket(this, "importbucket");
    Bucket exportBucket = new Bucket(this, "exportbucket");
    new DatabaseCluster(this, "dbcluster", new DatabaseClusterProps {
        Engine = DatabaseClusterEngine.AURORA,
        InstanceProps = new InstanceProps {
            Vpc = vpc
        },
        S3ImportBuckets = new [] { importBucket },
        S3ExportBuckets = new [] { exportBucket }
    });

    Creating a Database Proxy

    Amazon RDS Proxy sits between your application and your relational database to efficiently manage connections to the database and improve scalability of the application. Learn more about at Amazon RDS Proxy

    The following code configures an RDS Proxy for a DatabaseInstance.

    Vpc vpc;
    SecurityGroup securityGroup;
    Secret[] secrets;
    DatabaseInstance dbInstance;
    
    
    DatabaseProxy proxy = dbInstance.AddProxy("proxy", new DatabaseProxyOptions {
        BorrowTimeout = Duration.Seconds(30),
        MaxConnectionsPercent = 50,
        Secrets = secrets,
        Vpc = vpc
    });

    Exporting Logs

    You can publish database logs to Amazon CloudWatch Logs. With CloudWatch Logs, you can perform real-time analysis of the log data, store the data in highly durable storage, and manage the data with the CloudWatch Logs Agent. This is available for both database instances and clusters; the types of logs available depend on the database type and engine being used.

    using Amazon.CDK.AWS.Logs;
    Role myLogsPublishingRole;
    Vpc vpc;
    
    
    // Exporting logs from a cluster
    DatabaseCluster cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
        Engine = DatabaseClusterEngine.Aurora(new AuroraClusterEngineProps {
            Version = AuroraEngineVersion.VER_1_17_9
        }),
        InstanceProps = new InstanceProps {
            Vpc = vpc
        },
        CloudwatchLogsExports = new [] { "error", "general", "slowquery", "audit" },  // Export all available MySQL-based logs
        CloudwatchLogsRetention = RetentionDays.THREE_MONTHS,  // Optional - default is to never expire logs
        CloudwatchLogsRetentionRole = myLogsPublishingRole
    });
    
    // Exporting logs from an instance
    DatabaseInstance instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
        Engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps {
            Version = PostgresEngineVersion.VER_12_3
        }),
        Vpc = vpc,
        CloudwatchLogsExports = new [] { "postgresql" }
    });

    Option Groups

    Some DB engines offer additional features that make it easier to manage data and databases, and to provide additional security for your database. Amazon RDS uses option groups to enable and configure these features. An option group can specify features, called options, that are available for a particular Amazon RDS DB instance.

    Vpc vpc;
    SecurityGroup securityGroup;
    
    
    new OptionGroup(this, "Options", new OptionGroupProps {
        Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps {
            Version = OracleEngineVersion.VER_19
        }),
        Configurations = new [] { new OptionConfiguration {
            Name = "OEM",
            Port = 5500,
            Vpc = vpc,
            SecurityGroups = new [] { securityGroup }
        } }
    });

    Parameter Groups

    Database parameters specify how the database is configured. For example, database parameters can specify the amount of resources, such as memory, to allocate to a database. You manage your database configuration by associating your DB instances with parameter groups. Amazon RDS defines parameter groups with default settings.

    You can create your own parameter group for your cluster or instance and associate it with your database:

    Vpc vpc;
    
    
    ParameterGroup parameterGroup = new ParameterGroup(this, "ParameterGroup", new ParameterGroupProps {
        Engine = DatabaseInstanceEngine.SqlServerEe(new SqlServerEeInstanceEngineProps {
            Version = SqlServerEngineVersion.VER_11
        }),
        Parameters = new Dictionary<string, string> {
            { "locks", "100" }
        }
    });
    
    new DatabaseInstance(this, "Database", new DatabaseInstanceProps {
        Engine = DatabaseInstanceEngine.SQL_SERVER_EE,
        Vpc = vpc,
        ParameterGroup = parameterGroup
    });

    Another way to specify parameters is to use the inline field parameters that creates an RDS parameter group for you. You can use this if you do not want to reuse the parameter group instance for different instances:

    Vpc vpc;
    
    
    new DatabaseInstance(this, "Database", new DatabaseInstanceProps {
        Engine = DatabaseInstanceEngine.SqlServerEe(new SqlServerEeInstanceEngineProps { Version = SqlServerEngineVersion.VER_11 }),
        Vpc = vpc,
        Parameters = new Dictionary<string, string> {
            { "locks", "100" }
        }
    });

    You cannot specify a parameter map and a parameter group at the same time.

    Serverless

    Amazon Aurora Serverless is an on-demand, auto-scaling configuration for Amazon Aurora. The database will automatically start up, shut down, and scale capacity up or down based on your application's needs. It enables you to run your database in the cloud without managing any database instances.

    The following example initializes an Aurora Serverless PostgreSql cluster. Aurora Serverless clusters can specify scaling properties which will be used to automatically scale the database cluster seamlessly based on the workload.

    Vpc vpc;
    
    
    ServerlessCluster cluster = new ServerlessCluster(this, "AnotherCluster", new ServerlessClusterProps {
        Engine = DatabaseClusterEngine.AURORA_POSTGRESQL,
        ParameterGroup = ParameterGroup.FromParameterGroupName(this, "ParameterGroup", "default.aurora-postgresql10"),
        Vpc = vpc,
        Scaling = new ServerlessScalingOptions {
            AutoPause = Duration.Minutes(10),  // default is to pause after 5 minutes of idle time
            MinCapacity = AuroraCapacityUnit.ACU_8,  // default is 2 Aurora capacity units (ACUs)
            MaxCapacity = AuroraCapacityUnit.ACU_32
        }
    });

    Aurora Serverless Clusters do not support the following features:

      Read more about the limitations of Aurora Serverless

      Learn more about using Amazon Aurora Serverless by reading the documentation

      Use ServerlessClusterFromSnapshot to create a serverless cluster from a snapshot:

      Vpc vpc;
      
      new ServerlessClusterFromSnapshot(this, "Cluster", new ServerlessClusterFromSnapshotProps {
          Engine = DatabaseClusterEngine.AURORA_MYSQL,
          Vpc = vpc,
          SnapshotIdentifier = "mySnapshot"
      });

      Data API

      You can access your Aurora Serverless DB cluster using the built-in Data API. The Data API doesn't require a persistent connection to the DB cluster. Instead, it provides a secure HTTP endpoint and integration with AWS SDKs.

      The following example shows granting Data API access to a Lamba function.

      Vpc vpc;
      
      Code code;
      
      
      ServerlessCluster cluster = new ServerlessCluster(this, "AnotherCluster", new ServerlessClusterProps {
          Engine = DatabaseClusterEngine.AURORA_MYSQL,
          Vpc = vpc,  // this parameter is optional for serverless Clusters
          EnableDataApi = true
      });
      Function fn = new Function(this, "MyFunction", new FunctionProps {
          Runtime = Runtime.NODEJS_14_X,
          Handler = "index.handler",
          Code = code,
          Environment = new Dictionary<string, string> {
              { "CLUSTER_ARN", cluster.ClusterArn },
              { "SECRET_ARN", cluster.Secret.SecretArn }
          }
      });
      cluster.GrantDataApiAccess(fn);

      Note: To invoke the Data API, the resource will need to read the secret associated with the cluster.

      To learn more about using the Data API, see the documentation.

      Default VPC

      The vpc parameter is optional.

      If not provided, the cluster will be created in the default VPC of the account and region. As this VPC is not deployed with AWS CDK, you can't configure the vpcSubnets, subnetGroup or securityGroups of the Aurora Serverless Cluster. If you want to provide one of vpcSubnets, subnetGroup or securityGroups parameter, please provide a vpc.

      Classes

      AuroraCapacityUnit

      Aurora capacity units (ACUs).

      AuroraClusterEngineProps

      Creation properties of the plain Aurora database cluster engine.

      AuroraEngineVersion

      The versions for the Aurora cluster engine (those returned by {@link DatabaseClusterEngine.aurora}).

      AuroraMysqlClusterEngineProps

      Creation properties of the Aurora MySQL database cluster engine.

      AuroraMysqlEngineVersion

      The versions for the Aurora MySQL cluster engine (those returned by {@link DatabaseClusterEngine.auroraMysql}).

      AuroraPostgresClusterEngineProps

      Creation properties of the Aurora PostgreSQL database cluster engine.

      AuroraPostgresEngineFeatures

      Features supported by this version of the Aurora Postgres cluster engine.

      AuroraPostgresEngineVersion

      The versions for the Aurora PostgreSQL cluster engine (those returned by {@link DatabaseClusterEngine.auroraPostgres}).

      BackupProps

      Backup configuration for RDS databases.

      CfnDBCluster

      A CloudFormation AWS::RDS::DBCluster.

      CfnDBCluster.DBClusterRoleProperty

      Describes an AWS Identity and Access Management (IAM) role that is associated with a DB cluster.

      CfnDBCluster.EndpointProperty

      Specifies the connection endpoint for the primary instance of the DB cluster.

      CfnDBCluster.MasterUserSecretProperty

      Contains the secret managed by RDS in AWS Secrets Manager for the master user password.

      CfnDBCluster.ReadEndpointProperty

      The ReadEndpoint return value specifies the reader endpoint for the DB cluster.

      CfnDBCluster.ScalingConfigurationProperty

      The ScalingConfiguration property type specifies the scaling configuration of an Aurora Serverless DB cluster.

      CfnDBCluster.ServerlessV2ScalingConfigurationProperty

      The ServerlessV2ScalingConfiguration property type specifies the scaling configuration of an Aurora Serverless V2 DB cluster.

      CfnDBClusterParameterGroup

      A CloudFormation AWS::RDS::DBClusterParameterGroup.

      CfnDBClusterParameterGroupProps

      Properties for defining a CfnDBClusterParameterGroup.

      CfnDBClusterProps

      Properties for defining a CfnDBCluster.

      CfnDBInstance

      A CloudFormation AWS::RDS::DBInstance.

      CfnDBInstance.CertificateDetailsProperty

      Returns the details of the DB instance’s server certificate.

      CfnDBInstance.DBInstanceRoleProperty

      Describes an AWS Identity and Access Management (IAM) role that is associated with a DB instance.

      CfnDBInstance.EndpointProperty

      This data type represents the information you need to connect to an Amazon RDS DB instance.

      CfnDBInstance.MasterUserSecretProperty

      Contains the secret managed by RDS in AWS Secrets Manager for the master user password.

      CfnDBInstance.ProcessorFeatureProperty

      The ProcessorFeature property type specifies the processor features of a DB instance class status.

      CfnDBInstanceProps

      Properties for defining a CfnDBInstance.

      CfnDBParameterGroup

      A CloudFormation AWS::RDS::DBParameterGroup.

      CfnDBParameterGroupProps

      Properties for defining a CfnDBParameterGroup.

      CfnDBProxy

      A CloudFormation AWS::RDS::DBProxy.

      CfnDBProxy.AuthFormatProperty

      Specifies the details of authentication used by a proxy to log in as a specific database user.

      CfnDBProxy.TagFormatProperty

      Metadata assigned to a DB proxy consisting of a key-value pair.

      CfnDBProxyEndpoint

      A CloudFormation AWS::RDS::DBProxyEndpoint.

      CfnDBProxyEndpoint.TagFormatProperty

      Metadata assigned to a DB proxy endpoint consisting of a key-value pair.

      CfnDBProxyEndpointProps

      Properties for defining a CfnDBProxyEndpoint.

      CfnDBProxyProps

      Properties for defining a CfnDBProxy.

      CfnDBProxyTargetGroup

      A CloudFormation AWS::RDS::DBProxyTargetGroup.

      CfnDBProxyTargetGroup.ConnectionPoolConfigurationInfoFormatProperty

      Specifies the settings that control the size and behavior of the connection pool associated with a DBProxyTargetGroup .

      CfnDBProxyTargetGroupProps

      Properties for defining a CfnDBProxyTargetGroup.

      CfnDBSecurityGroup

      A CloudFormation AWS::RDS::DBSecurityGroup.

      CfnDBSecurityGroup.IngressProperty

      The Ingress property type specifies an individual ingress rule within an AWS::RDS::DBSecurityGroup resource.

      CfnDBSecurityGroupIngress

      A CloudFormation AWS::RDS::DBSecurityGroupIngress.

      CfnDBSecurityGroupIngressProps

      Properties for defining a CfnDBSecurityGroupIngress.

      CfnDBSecurityGroupProps

      Properties for defining a CfnDBSecurityGroup.

      CfnDBSubnetGroup

      A CloudFormation AWS::RDS::DBSubnetGroup.

      CfnDBSubnetGroupProps

      Properties for defining a CfnDBSubnetGroup.

      CfnEventSubscription

      A CloudFormation AWS::RDS::EventSubscription.

      CfnEventSubscriptionProps

      Properties for defining a CfnEventSubscription.

      CfnGlobalCluster

      A CloudFormation AWS::RDS::GlobalCluster.

      CfnGlobalClusterProps

      Properties for defining a CfnGlobalCluster.

      CfnOptionGroup

      A CloudFormation AWS::RDS::OptionGroup.

      CfnOptionGroup.OptionConfigurationProperty

      The OptionConfiguration property type specifies an individual option, and its settings, within an AWS::RDS::OptionGroup resource.

      CfnOptionGroup.OptionSettingProperty

      The OptionSetting property type specifies the value for an option within an OptionSetting property.

      CfnOptionGroupProps

      Properties for defining a CfnOptionGroup.

      ClusterEngineBindOptions

      The extra options passed to the {@link IClusterEngine.bindToCluster} method.

      ClusterEngineConfig

      The type returned from the {@link IClusterEngine.bindToCluster} method.

      ClusterEngineFeatures

      Represents Database Engine features.

      CommonRotationUserOptions

      Properties common to single-user and multi-user rotation options.

      Credentials

      Username and password combination.

      CredentialsBaseOptions

      Base options for creating Credentials.

      CredentialsFromUsernameOptions

      Options for creating Credentials from a username.

      DatabaseCluster

      Create a clustered database with a given number of instances.

      DatabaseClusterAttributes

      Properties that describe an existing cluster instance.

      DatabaseClusterBase

      A new or imported clustered database.

      DatabaseClusterEngine

      A database cluster engine.

      DatabaseClusterFromSnapshot

      A database cluster restored from a snapshot.

      DatabaseClusterFromSnapshotProps

      Properties for DatabaseClusterFromSnapshot.

      DatabaseClusterProps

      Properties for a new database cluster.

      DatabaseInstance

      A database instance.

      DatabaseInstanceAttributes

      Properties that describe an existing instance.

      DatabaseInstanceBase

      A new or imported database instance.

      DatabaseInstanceEngine

      A database instance engine.

      DatabaseInstanceFromSnapshot

      A database instance restored from a snapshot.

      DatabaseInstanceFromSnapshotProps

      Construction properties for a DatabaseInstanceFromSnapshot.

      DatabaseInstanceNewProps

      Construction properties for a DatabaseInstanceNew.

      DatabaseInstanceProps

      Construction properties for a DatabaseInstance.

      DatabaseInstanceReadReplica

      A read replica database instance.

      DatabaseInstanceReadReplicaProps

      Construction properties for a DatabaseInstanceReadReplica.

      DatabaseInstanceSourceProps

      Construction properties for a DatabaseInstanceSource.

      DatabaseProxy

      RDS Database Proxy.

      DatabaseProxyAttributes

      Properties that describe an existing DB Proxy.

      DatabaseProxyOptions

      Options for a new DatabaseProxy.

      DatabaseProxyProps

      Construction properties for a DatabaseProxy.

      DatabaseSecret

      A database secret.

      DatabaseSecretProps

      Construction properties for a DatabaseSecret.

      Endpoint

      Connection endpoint of a database cluster or instance.

      EngineVersion

      A version of an engine - for either a cluster, or instance.

      InstanceEngineBindOptions

      The options passed to {@link IInstanceEngine.bind}.

      InstanceEngineConfig

      The type returned from the {@link IInstanceEngine.bind} method.

      InstanceEngineFeatures

      Represents Database Engine features.

      InstanceProps

      Instance properties for database instances.

      LicenseModel

      The license model.

      MariaDbEngineVersion

      The versions for the MariaDB instance engines (those returned by {@link DatabaseInstanceEngine.mariaDb}).

      MariaDbInstanceEngineProps

      Properties for MariaDB instance engines.

      MysqlEngineVersion

      The versions for the MySQL instance engines (those returned by {@link DatabaseInstanceEngine.mysql}).

      MySqlInstanceEngineProps

      Properties for MySQL instance engines.

      OptionConfiguration

      Configuration properties for an option.

      OptionGroup

      An option group.

      OptionGroupProps

      Construction properties for an OptionGroup.

      OracleEeInstanceEngineProps

      Properties for Oracle Enterprise Edition instance engines.

      OracleEngineVersion

      The versions for the Oracle instance engines (those returned by {@link DatabaseInstanceEngine.oracleSe2} and {@link DatabaseInstanceEngine.oracleEe}).

      OracleLegacyEngineVersion

      (deprecated) The versions for the legacy Oracle instance engines (those returned by {@link DatabaseInstanceEngine.oracleSe} and {@link DatabaseInstanceEngine.oracleSe1}). Note: RDS will stop allowing creating new databases with this version in August 2020.

      OracleSe1InstanceEngineProps

      (deprecated) Properties for Oracle Standard Edition 1 instance engines.

      OracleSe2InstanceEngineProps

      Properties for Oracle Standard Edition 2 instance engines.

      OracleSeInstanceEngineProps

      (deprecated) Properties for Oracle Standard Edition instance engines.

      ParameterGroup

      A parameter group.

      ParameterGroupClusterBindOptions

      Options for {@link IParameterGroup.bindToCluster}. Empty for now, but can be extended later.

      ParameterGroupClusterConfig

      The type returned from {@link IParameterGroup.bindToCluster}.

      ParameterGroupInstanceBindOptions

      Options for {@link IParameterGroup.bindToInstance}. Empty for now, but can be extended later.

      ParameterGroupInstanceConfig

      The type returned from {@link IParameterGroup.bindToInstance}.

      ParameterGroupProps

      Properties for a parameter group.

      PerformanceInsightRetention

      The retention period for Performance Insight.

      PostgresEngineFeatures

      Features supported by the Postgres database engine.

      PostgresEngineVersion

      The versions for the PostgreSQL instance engines (those returned by {@link DatabaseInstanceEngine.postgres}).

      PostgresInstanceEngineProps

      Properties for PostgreSQL instance engines.

      ProcessorFeatures

      The processor features.

      ProxyTarget

      Proxy target: Instance or Cluster.

      ProxyTargetConfig

      The result of binding a ProxyTarget to a DatabaseProxy.

      RotationMultiUserOptions

      Options to add the multi user rotation.

      RotationSingleUserOptions

      Options to add the multi user rotation.

      ServerlessCluster

      Create an Aurora Serverless Cluster.

      ServerlessClusterAttributes

      Properties that describe an existing cluster instance.

      ServerlessClusterFromSnapshot

      A Aurora Serverless Cluster restored from a snapshot.

      ServerlessClusterFromSnapshotProps

      Properties for ServerlessClusterFromSnapshot.

      ServerlessClusterProps

      Properties for a new Aurora Serverless Cluster.

      ServerlessScalingOptions

      Options for configuring scaling on an Aurora Serverless cluster.

      SessionPinningFilter

      SessionPinningFilter.

      SnapshotCredentials

      Credentials to update the password for a DatabaseInstanceFromSnapshot.

      SnapshotCredentialsFromGeneratedPasswordOptions

      Options used in the {@link SnapshotCredentials.fromGeneratedPassword} method.

      SqlServerEeInstanceEngineProps

      Properties for SQL Server Enterprise Edition instance engines.

      SqlServerEngineVersion

      The versions for the SQL Server instance engines (those returned by {@link DatabaseInstanceEngine.sqlServerSe}, {@link DatabaseInstanceEngine.sqlServerEx}, {@link DatabaseInstanceEngine.sqlServerWeb} and {@link DatabaseInstanceEngine.sqlServerEe}).

      SqlServerExInstanceEngineProps

      Properties for SQL Server Express Edition instance engines.

      SqlServerSeInstanceEngineProps

      Properties for SQL Server Standard Edition instance engines.

      SqlServerWebInstanceEngineProps

      Properties for SQL Server Web Edition instance engines.

      StorageType

      The type of storage.

      SubnetGroup

      Class for creating a RDS DB subnet group.

      SubnetGroupProps

      Properties for creating a SubnetGroup.

      Interfaces

      CfnDBCluster.IDBClusterRoleProperty

      Describes an AWS Identity and Access Management (IAM) role that is associated with a DB cluster.

      CfnDBCluster.IEndpointProperty

      Specifies the connection endpoint for the primary instance of the DB cluster.

      CfnDBCluster.IMasterUserSecretProperty

      Contains the secret managed by RDS in AWS Secrets Manager for the master user password.

      CfnDBCluster.IReadEndpointProperty

      The ReadEndpoint return value specifies the reader endpoint for the DB cluster.

      CfnDBCluster.IScalingConfigurationProperty

      The ScalingConfiguration property type specifies the scaling configuration of an Aurora Serverless DB cluster.

      CfnDBCluster.IServerlessV2ScalingConfigurationProperty

      The ServerlessV2ScalingConfiguration property type specifies the scaling configuration of an Aurora Serverless V2 DB cluster.

      CfnDBInstance.ICertificateDetailsProperty

      Returns the details of the DB instance’s server certificate.

      CfnDBInstance.IDBInstanceRoleProperty

      Describes an AWS Identity and Access Management (IAM) role that is associated with a DB instance.

      CfnDBInstance.IEndpointProperty

      This data type represents the information you need to connect to an Amazon RDS DB instance.

      CfnDBInstance.IMasterUserSecretProperty

      Contains the secret managed by RDS in AWS Secrets Manager for the master user password.

      CfnDBInstance.IProcessorFeatureProperty

      The ProcessorFeature property type specifies the processor features of a DB instance class status.

      CfnDBProxy.IAuthFormatProperty

      Specifies the details of authentication used by a proxy to log in as a specific database user.

      CfnDBProxy.ITagFormatProperty

      Metadata assigned to a DB proxy consisting of a key-value pair.

      CfnDBProxyEndpoint.ITagFormatProperty

      Metadata assigned to a DB proxy endpoint consisting of a key-value pair.

      CfnDBProxyTargetGroup.IConnectionPoolConfigurationInfoFormatProperty

      Specifies the settings that control the size and behavior of the connection pool associated with a DBProxyTargetGroup .

      CfnDBSecurityGroup.IIngressProperty

      The Ingress property type specifies an individual ingress rule within an AWS::RDS::DBSecurityGroup resource.

      CfnOptionGroup.IOptionConfigurationProperty

      The OptionConfiguration property type specifies an individual option, and its settings, within an AWS::RDS::OptionGroup resource.

      CfnOptionGroup.IOptionSettingProperty

      The OptionSetting property type specifies the value for an option within an OptionSetting property.

      IAuroraClusterEngineProps

      Creation properties of the plain Aurora database cluster engine.

      IAuroraMysqlClusterEngineProps

      Creation properties of the Aurora MySQL database cluster engine.

      IAuroraPostgresClusterEngineProps

      Creation properties of the Aurora PostgreSQL database cluster engine.

      IAuroraPostgresEngineFeatures

      Features supported by this version of the Aurora Postgres cluster engine.

      IBackupProps

      Backup configuration for RDS databases.

      ICfnDBClusterParameterGroupProps

      Properties for defining a CfnDBClusterParameterGroup.

      ICfnDBClusterProps

      Properties for defining a CfnDBCluster.

      ICfnDBInstanceProps

      Properties for defining a CfnDBInstance.

      ICfnDBParameterGroupProps

      Properties for defining a CfnDBParameterGroup.

      ICfnDBProxyEndpointProps

      Properties for defining a CfnDBProxyEndpoint.

      ICfnDBProxyProps

      Properties for defining a CfnDBProxy.

      ICfnDBProxyTargetGroupProps

      Properties for defining a CfnDBProxyTargetGroup.

      ICfnDBSecurityGroupIngressProps

      Properties for defining a CfnDBSecurityGroupIngress.

      ICfnDBSecurityGroupProps

      Properties for defining a CfnDBSecurityGroup.

      ICfnDBSubnetGroupProps

      Properties for defining a CfnDBSubnetGroup.

      ICfnEventSubscriptionProps

      Properties for defining a CfnEventSubscription.

      ICfnGlobalClusterProps

      Properties for defining a CfnGlobalCluster.

      ICfnOptionGroupProps

      Properties for defining a CfnOptionGroup.

      IClusterEngine

      The interface representing a database cluster (as opposed to instance) engine.

      IClusterEngineBindOptions

      The extra options passed to the {@link IClusterEngine.bindToCluster} method.

      IClusterEngineConfig

      The type returned from the {@link IClusterEngine.bindToCluster} method.

      IClusterEngineFeatures

      Represents Database Engine features.

      ICommonRotationUserOptions

      Properties common to single-user and multi-user rotation options.

      ICredentialsBaseOptions

      Base options for creating Credentials.

      ICredentialsFromUsernameOptions

      Options for creating Credentials from a username.

      IDatabaseCluster

      Create a clustered database with a given number of instances.

      IDatabaseClusterAttributes

      Properties that describe an existing cluster instance.

      IDatabaseClusterFromSnapshotProps

      Properties for DatabaseClusterFromSnapshot.

      IDatabaseClusterProps

      Properties for a new database cluster.

      IDatabaseInstance

      A database instance.

      IDatabaseInstanceAttributes

      Properties that describe an existing instance.

      IDatabaseInstanceFromSnapshotProps

      Construction properties for a DatabaseInstanceFromSnapshot.

      IDatabaseInstanceNewProps

      Construction properties for a DatabaseInstanceNew.

      IDatabaseInstanceProps

      Construction properties for a DatabaseInstance.

      IDatabaseInstanceReadReplicaProps

      Construction properties for a DatabaseInstanceReadReplica.

      IDatabaseInstanceSourceProps

      Construction properties for a DatabaseInstanceSource.

      IDatabaseProxy

      DB Proxy.

      IDatabaseProxyAttributes

      Properties that describe an existing DB Proxy.

      IDatabaseProxyOptions

      Options for a new DatabaseProxy.

      IDatabaseProxyProps

      Construction properties for a DatabaseProxy.

      IDatabaseSecretProps

      Construction properties for a DatabaseSecret.

      IEngine

      A common interface for database engines.

      IEngineVersion

      A version of an engine - for either a cluster, or instance.

      IInstanceEngine

      Interface representing a database instance (as opposed to cluster) engine.

      IInstanceEngineBindOptions

      The options passed to {@link IInstanceEngine.bind}.

      IInstanceEngineConfig

      The type returned from the {@link IInstanceEngine.bind} method.

      IInstanceEngineFeatures

      Represents Database Engine features.

      IInstanceProps

      Instance properties for database instances.

      IMariaDbInstanceEngineProps

      Properties for MariaDB instance engines.

      IMySqlInstanceEngineProps

      Properties for MySQL instance engines.

      IOptionConfiguration

      Configuration properties for an option.

      IOptionGroup

      An option group.

      IOptionGroupProps

      Construction properties for an OptionGroup.

      IOracleEeInstanceEngineProps

      Properties for Oracle Enterprise Edition instance engines.

      IOracleSe1InstanceEngineProps

      (deprecated) Properties for Oracle Standard Edition 1 instance engines.

      IOracleSe2InstanceEngineProps

      Properties for Oracle Standard Edition 2 instance engines.

      IOracleSeInstanceEngineProps

      (deprecated) Properties for Oracle Standard Edition instance engines.

      IParameterGroup

      A parameter group.

      IParameterGroupClusterBindOptions

      Options for {@link IParameterGroup.bindToCluster}. Empty for now, but can be extended later.

      IParameterGroupClusterConfig

      The type returned from {@link IParameterGroup.bindToCluster}.

      IParameterGroupInstanceBindOptions

      Options for {@link IParameterGroup.bindToInstance}. Empty for now, but can be extended later.

      IParameterGroupInstanceConfig

      The type returned from {@link IParameterGroup.bindToInstance}.

      IParameterGroupProps

      Properties for a parameter group.

      IPostgresEngineFeatures

      Features supported by the Postgres database engine.

      IPostgresInstanceEngineProps

      Properties for PostgreSQL instance engines.

      IProcessorFeatures

      The processor features.

      IProxyTargetConfig

      The result of binding a ProxyTarget to a DatabaseProxy.

      IRotationMultiUserOptions

      Options to add the multi user rotation.

      IRotationSingleUserOptions

      Options to add the multi user rotation.

      IServerlessCluster

      Interface representing a serverless database cluster.

      IServerlessClusterAttributes

      Properties that describe an existing cluster instance.

      IServerlessClusterFromSnapshotProps

      Properties for ServerlessClusterFromSnapshot.

      IServerlessClusterProps

      Properties for a new Aurora Serverless Cluster.

      IServerlessScalingOptions

      Options for configuring scaling on an Aurora Serverless cluster.

      ISnapshotCredentialsFromGeneratedPasswordOptions

      Options used in the {@link SnapshotCredentials.fromGeneratedPassword} method.

      ISqlServerEeInstanceEngineProps

      Properties for SQL Server Enterprise Edition instance engines.

      ISqlServerExInstanceEngineProps

      Properties for SQL Server Express Edition instance engines.

      ISqlServerSeInstanceEngineProps

      Properties for SQL Server Standard Edition instance engines.

      ISqlServerWebInstanceEngineProps

      Properties for SQL Server Web Edition instance engines.

      ISubnetGroup

      Interface for a subnet group.

      ISubnetGroupProps

      Properties for creating a SubnetGroup.

      Back to top Generated by DocFX