Skip to content

Commit fedf52a

Browse files
author
awstools
committed
feat(client-rds): Add support for creating a read replica DB instance from a Multi-AZ DB cluster.
1 parent ca26c26 commit fedf52a

File tree

8 files changed

+267
-179
lines changed

8 files changed

+267
-179
lines changed

clients/client-rds/src/RDS.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,13 +1353,14 @@ export class RDS extends RDSClient {
13531353
* request creates a writer and two reader DB instances for you, each in a different
13541354
* Availability Zone.</p>
13551355
* <p>You can use the <code>ReplicationSourceIdentifier</code> parameter to create an Amazon
1356-
* Aurora DB cluster as a read replica of another DB cluster or Amazon RDS MySQL or
1356+
* Aurora DB cluster as a read replica of another DB cluster or Amazon RDS for MySQL or
13571357
* PostgreSQL DB instance. For more information about Amazon Aurora, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html">What is Amazon Aurora?</a> in the <i>Amazon Aurora User
1358-
* Guide</i>.</p>
1358+
* Guide</i>.</p>
13591359
* <p>You can also use the <code>ReplicationSourceIdentifier</code> parameter to create a
1360-
* Multi-AZ DB cluster read replica with an RDS for PostgreSQL DB instance as the source.
1361-
* For more information about Multi-AZ DB clusters, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html">Multi-AZ DB cluster deployments</a> in the <i>Amazon
1362-
* RDS User Guide</i>.</p>
1360+
* Multi-AZ DB cluster read replica with an RDS for MySQL or PostgreSQL DB instance as the
1361+
* source. For more information about Multi-AZ DB clusters, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html">Multi-AZ DB
1362+
* cluster deployments</a> in the <i>Amazon RDS User
1363+
* Guide</i>.</p>
13631364
*/
13641365
public createDBCluster(
13651366
args: CreateDBClusterCommandInput,
@@ -1570,16 +1571,17 @@ export class RDS extends RDSClient {
15701571
/**
15711572
* @public
15721573
* <p>Creates a new DB instance that acts as a read replica for an existing source DB
1573-
* instance. You can create a read replica for a DB instance running MySQL, MariaDB,
1574-
* Oracle, PostgreSQL, or SQL Server. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html">Working with Read
1575-
* Replicas</a> in the <i>Amazon RDS User Guide</i>.</p>
1574+
* instance or Multi-AZ DB cluster. You can create a read replica for a DB instance running
1575+
* MySQL, MariaDB, Oracle, PostgreSQL, or SQL Server. You can create a read replica for a
1576+
* Multi-AZ DB cluster running MySQL or PostgreSQL. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html">Working
1577+
* with read replicas</a> and <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html#multi-az-db-clusters-migrating-to-instance-with-read-replica">Migrating from a Multi-AZ DB cluster to a DB instance using a read replica</a> in the <i>Amazon RDS User Guide</i>.</p>
15761578
* <p>Amazon Aurora doesn't support this operation. Call the <code>CreateDBInstance</code>
15771579
* operation to create a DB instance for an Aurora DB cluster.</p>
1578-
* <p>All read replica DB instances are created with backups disabled. All other DB
1579-
* instance attributes (including DB security groups and DB parameter groups) are inherited
1580-
* from the source DB instance, except as specified.</p>
1580+
* <p>All read replica DB instances are created with backups disabled. All other attributes
1581+
* (including DB security groups and DB parameter groups) are inherited from the source DB
1582+
* instance or cluster, except as specified.</p>
15811583
* <important>
1582-
* <p>Your source DB instance must have backup retention enabled.</p>
1584+
* <p>Your source DB instance or cluster must have backup retention enabled.</p>
15831585
* </important>
15841586
*/
15851587
public createDBInstanceReadReplica(
@@ -2070,6 +2072,8 @@ export class RDS extends RDSClient {
20702072
* <p>The DeleteDBCluster action deletes a previously provisioned DB cluster.
20712073
* When you delete a DB cluster, all automated backups for that DB cluster are deleted and can't be recovered.
20722074
* Manual DB cluster snapshots of the specified DB cluster are not deleted.</p>
2075+
* <p>If you're deleting a Multi-AZ DB cluster with read replicas, all cluster members are
2076+
* terminated and read replicas are promoted to standalone instances.</p>
20732077
* <p>For more information on Amazon Aurora, see
20742078
* <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html">
20752079
* What is Amazon Aurora?</a> in the <i>Amazon Aurora User Guide</i>.</p>

clients/client-rds/src/commands/CreateDBClusterCommand.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ export interface CreateDBClusterCommandOutput extends CreateDBClusterResult, __M
4242
* request creates a writer and two reader DB instances for you, each in a different
4343
* Availability Zone.</p>
4444
* <p>You can use the <code>ReplicationSourceIdentifier</code> parameter to create an Amazon
45-
* Aurora DB cluster as a read replica of another DB cluster or Amazon RDS MySQL or
45+
* Aurora DB cluster as a read replica of another DB cluster or Amazon RDS for MySQL or
4646
* PostgreSQL DB instance. For more information about Amazon Aurora, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html">What is Amazon Aurora?</a> in the <i>Amazon Aurora User
47-
* Guide</i>.</p>
47+
* Guide</i>.</p>
4848
* <p>You can also use the <code>ReplicationSourceIdentifier</code> parameter to create a
49-
* Multi-AZ DB cluster read replica with an RDS for PostgreSQL DB instance as the source.
50-
* For more information about Multi-AZ DB clusters, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html">Multi-AZ DB cluster deployments</a> in the <i>Amazon
51-
* RDS User Guide</i>.</p>
49+
* Multi-AZ DB cluster read replica with an RDS for MySQL or PostgreSQL DB instance as the
50+
* source. For more information about Multi-AZ DB clusters, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html">Multi-AZ DB
51+
* cluster deployments</a> in the <i>Amazon RDS User
52+
* Guide</i>.</p>
5253
* @example
5354
* Use a bare-bones client and the command you need to make an API call.
5455
* ```javascript

clients/client-rds/src/commands/CreateDBInstanceReadReplicaCommand.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ export interface CreateDBInstanceReadReplicaCommandOutput extends CreateDBInstan
3737
/**
3838
* @public
3939
* <p>Creates a new DB instance that acts as a read replica for an existing source DB
40-
* instance. You can create a read replica for a DB instance running MySQL, MariaDB,
41-
* Oracle, PostgreSQL, or SQL Server. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html">Working with Read
42-
* Replicas</a> in the <i>Amazon RDS User Guide</i>.</p>
40+
* instance or Multi-AZ DB cluster. You can create a read replica for a DB instance running
41+
* MySQL, MariaDB, Oracle, PostgreSQL, or SQL Server. You can create a read replica for a
42+
* Multi-AZ DB cluster running MySQL or PostgreSQL. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html">Working
43+
* with read replicas</a> and <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html#multi-az-db-clusters-migrating-to-instance-with-read-replica">Migrating from a Multi-AZ DB cluster to a DB instance using a read replica</a> in the <i>Amazon RDS User Guide</i>.</p>
4344
* <p>Amazon Aurora doesn't support this operation. Call the <code>CreateDBInstance</code>
4445
* operation to create a DB instance for an Aurora DB cluster.</p>
45-
* <p>All read replica DB instances are created with backups disabled. All other DB
46-
* instance attributes (including DB security groups and DB parameter groups) are inherited
47-
* from the source DB instance, except as specified.</p>
46+
* <p>All read replica DB instances are created with backups disabled. All other attributes
47+
* (including DB security groups and DB parameter groups) are inherited from the source DB
48+
* instance or cluster, except as specified.</p>
4849
* <important>
49-
* <p>Your source DB instance must have backup retention enabled.</p>
50+
* <p>Your source DB instance or cluster must have backup retention enabled.</p>
5051
* </important>
5152
* @example
5253
* Use a bare-bones client and the command you need to make an API call.
@@ -56,7 +57,7 @@ export interface CreateDBInstanceReadReplicaCommandOutput extends CreateDBInstan
5657
* const client = new RDSClient(config);
5758
* const input = { // CreateDBInstanceReadReplicaMessage
5859
* DBInstanceIdentifier: "STRING_VALUE", // required
59-
* SourceDBInstanceIdentifier: "STRING_VALUE", // required
60+
* SourceDBInstanceIdentifier: "STRING_VALUE",
6061
* DBInstanceClass: "STRING_VALUE",
6162
* AvailabilityZone: "STRING_VALUE",
6263
* Port: Number("int"),
@@ -106,6 +107,7 @@ export interface CreateDBInstanceReadReplicaCommandOutput extends CreateDBInstan
106107
* StorageThroughput: Number("int"),
107108
* EnableCustomerOwnedIp: true || false,
108109
* AllocatedStorage: Number("int"),
110+
* SourceDBClusterIdentifier: "STRING_VALUE",
109111
* };
110112
* const command = new CreateDBInstanceReadReplicaCommand(input);
111113
* const response = await client.send(command);
@@ -117,6 +119,10 @@ export interface CreateDBInstanceReadReplicaCommandOutput extends CreateDBInstan
117119
* @see {@link CreateDBInstanceReadReplicaCommandOutput} for command's `response` shape.
118120
* @see {@link RDSClientResolvedConfig | config} for RDSClient's `config` shape.
119121
*
122+
* @throws {@link DBClusterNotFoundFault} (client fault)
123+
* <p>
124+
* <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
125+
*
120126
* @throws {@link DBInstanceAlreadyExistsFault} (client fault)
121127
* <p>The user already has a DB instance with the given identifier.</p>
122128
*
@@ -156,6 +162,9 @@ export interface CreateDBInstanceReadReplicaCommandOutput extends CreateDBInstan
156162
* <p>The specified DB instance class isn't available in the specified Availability
157163
* Zone.</p>
158164
*
165+
* @throws {@link InvalidDBClusterStateFault} (client fault)
166+
* <p>The requested operation can't be performed while the cluster is in this state.</p>
167+
*
159168
* @throws {@link InvalidDBInstanceStateFault} (client fault)
160169
* <p>The DB instance isn't in a valid state.</p>
161170
*

clients/client-rds/src/commands/DeleteDBClusterCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export interface DeleteDBClusterCommandOutput extends DeleteDBClusterResult, __M
3838
* <p>The DeleteDBCluster action deletes a previously provisioned DB cluster.
3939
* When you delete a DB cluster, all automated backups for that DB cluster are deleted and can't be recovered.
4040
* Manual DB cluster snapshots of the specified DB cluster are not deleted.</p>
41+
* <p>If you're deleting a Multi-AZ DB cluster with read replicas, all cluster members are
42+
* terminated and read replicas are promoted to standalone instances.</p>
4143
* <p>For more information on Amazon Aurora, see
4244
* <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html">
4345
* What is Amazon Aurora?</a> in the <i>Amazon Aurora User Guide</i>.</p>

0 commit comments

Comments
 (0)