PromoteReadReplica
Promotes a read replica DB instance to a standalone DB instance.
Note
-
Backup duration is a function of the amount of changes to the database since the previous backup. If you plan to promote a read replica to a standalone instance, we recommend that you enable backups and complete at least one backup prior to promotion. In addition, a read replica cannot be promoted to a standalone instance when it is in the
backing-upstatus. If you have enabled backups on your read replica, configure the automated backup window so that daily backups do not interfere with read replica promotion. -
This command doesn't apply to Aurora MySQL, Aurora PostgreSQL, or RDS Custom.
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
- DBInstanceIdentifier
-
The DB instance identifier. This value is stored as a lowercase string.
Constraints:
-
Must match the identifier of an existing read replica DB instance.
Example:
mydbinstanceType: String
Required: Yes
-
- BackupRetentionPeriod
-
The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.
Default: 1
Constraints:
-
Must be a value from 0 to 35.
-
Can't be set to 0 if the DB instance is a source to read replicas.
Type: Integer
Required: No
-
- PreferredBackupWindow
-
The daily time range during which automated backups are created if automated backups are enabled, using the
BackupRetentionPeriodparameter.The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see Adjusting the Preferred Maintenance Window in the Amazon RDS User Guide.
Constraints:
-
Must be in the format
hh24:mi-hh24:mi. -
Must be in Universal Coordinated Time (UTC).
-
Must not conflict with the preferred maintenance window.
-
Must be at least 30 minutes.
Type: String
Required: No
-
- TagSpecifications.item.N
-
Tags to assign to resources associated with the DB instance.
Valid Values:
-
auto-backup- The DB instance's automated backup.
Type: Array of TagSpecification objects
Required: No
-
Response Elements
The following element is returned by the service.
- DBInstance
-
Contains the details of an Amazon RDS DB instance.
This data type is used as a response element in the operations
CreateDBInstance,CreateDBInstanceReadReplica,DeleteDBInstance,DescribeDBInstances,ModifyDBInstance,PromoteReadReplica,RebootDBInstance,RestoreDBInstanceFromDBSnapshot,RestoreDBInstanceFromS3,RestoreDBInstanceToPointInTime,StartDBInstance, andStopDBInstance.Type: DBInstance object
Errors
For information about the errors that are common to all actions, see Common Error Types.
- DBInstanceNotFound
-
DBInstanceIdentifierdoesn't refer to an existing DB instance.HTTP Status Code: 404
- InvalidDBInstanceState
-
The DB instance isn't in a valid state.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of PromoteReadReplica.
Sample Request
https://rds.us-east-1.amazonaws.com/
?Action=PromoteReadReplica
&BackupRetentionPeriod=7
&DBInstanceIdentifier=mysqldb-rr
&SignatureMethod=HmacSHA256
&SignatureVersion=4
&Version=2014-10-31
&X-Amz-Algorithm=AWS4-HMAC-SHA256
&X-Amz-Credential=AKIADQKE4SARGYLE/20140428/us-east-1/rds/aws4_request
&X-Amz-Date=20140428T221536Z
&X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date
&X-Amz-Signature=c0b2cfc3db8334b6ef86922f664e05ab306754e30e408d9fd3c8e58069a9b386
Sample Response
0
modifying
false
mysqldb-rr
08:25-08:55
fri:04:50-fri:05:20
replicating
read replication
true
us-east-1a
mysql
7
general-public-license
in-sync
default.mysql5.6
3306
mysqldb-rr.cg029hpkxcjt.us-east-1.rds.amazonaws.com
5.6.13
mysqldb
default:mysql-5-6
in-sync
true
active
default
true
mysqldb
2014-04-25T17:12:34.460Z
100
db.m1.medium
myawsuser
8e8c0d64-be21-11d3-a71c-13dc2f771e41
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: