createDbInstanceReadReplica
Creates a new DB instance that acts as a read replica for an existing source DB instance or Multi-AZ DB cluster. You can create a read replica for a DB instance running MariaDB, MySQL, Oracle, PostgreSQL, or SQL Server. You can create a read replica for a Multi-AZ DB cluster running MySQL or PostgreSQL. For more information, see Working with read replicas and Migrating from a Multi-AZ DB cluster to a DB instance using a read replica in the Amazon RDS User Guide.
Amazon RDS for Db2 supports this operation for standby replicas. To create a standby replica for a DB instance running Db2, you must set ReplicaMode
to mounted
.
Amazon Aurora doesn't support this operation. To create a DB instance for an Aurora DB cluster, use the CreateDBInstance
operation.
RDS creates read replicas with backups disabled. All other attributes (including DB security groups and DB parameter groups) are inherited from the source DB instance or cluster, except as specified.
Your source DB instance or cluster must have backup retention enabled.
Samples
fun main() {
//sampleStart
// This example creates a read replica of an existing DB instance named test instance. The read replica
// is named test instance repl.
val resp = rdsClient.createDbInstanceReadReplica {
dbInstanceIdentifier = "test-instance-repl"
sourceDbInstanceIdentifier = "test-instance"
}
//sampleEnd
}