Modifying an Amazon RDS DB instance
You can change the settings of a DB instance to accomplish tasks such as adding additional storage or changing the DB instance class. In this topic, you can find out how to modify an Amazon RDS DB instance and learn about the settings for DB instances.
We recommend that you test any changes on a test instance before modifying a production instance, so that you fully understand the impact of each change. Testing is especially important when upgrading database versions.
Most modifications to a DB instance you can either apply immediately or defer until the next maintenance window. Some modifications, such as parameter group changes, require that you manually reboot your DB instance for the change to take effect.
Some modifications result in an outage because Amazon RDS must reboot your DB instance for the change to take effect. Review the impact to your database and applications before modifying your DB instance settings.
To modify a DB instance
-
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.amazonaws.cn/rds/
. -
In the navigation pane, choose Databases, and then choose the DB instance that you want to modify.
-
Choose Modify. The Modify DB Instance page appears.
-
Change any of the settings that you want. For information about each setting, see Settings for DB instances.
-
When all the changes are as you want them, choose Continue and check the summary of modifications.
-
(Optional) Choose Apply immediately to apply the changes immediately. Choosing this option can cause an outage in some cases. For more information, see Using the Apply Immediately setting.
-
On the confirmation page, review your changes. If they are correct, choose Modify DB Instance to save your changes.
Or choose Back to edit your changes or Cancel to cancel your changes.
To modify a DB instance by using the AWS CLI, call the modify-db-instance command. Specify the DB instance identifier and the values for the options that you want to modify. For information about each option, see Settings for DB instances.
Example
The following code modifies mydbinstance
by setting the backup retention period to 1 week (7 days).
The code enables deletion protection by using --deletion-protection
.
To disable deletion protection, use --no-deletion-protection
.
The changes are applied during the next maintenance window
by using --no-apply-immediately
. Use --apply-immediately
to apply the changes immediately. For more information, see
Using the Apply Immediately setting.
For Linux, macOS, or Unix:
aws rds modify-db-instance \ --db-instance-identifier
mydbinstance
\ --backup-retention-period7
\--deletion-protection
\--no-apply-immediately
For Windows:
aws rds modify-db-instance ^ --db-instance-identifier
mydbinstance
^ --backup-retention-period7
^--deletion-protection
^--no-apply-immediately
To modify a DB instance by using the Amazon RDS API, call the ModifyDBInstance operation. Specify the DB instance identifier, and the parameters for the settings that you want to modify. For information about each parameter, see Settings for DB instances.
Using the Apply Immediately setting
When you modify a DB instance, you can apply the changes immediately. To apply changes
immediately, you choose the Apply Immediately option in
the AWS Management Console. Or you use the --apply-immediately
parameter when calling
the AWS CLI or set the ApplyImmediately
parameter to true
when
using the Amazon RDS API.
If you don't choose to apply changes immediately, the changes are put into the pending modifications queue. During the next maintenance window, any pending changes in the queue are applied. If you choose to apply changes immediately, your new changes and any changes in the pending modifications queue are applied.
If any of the pending modifications require downtime, choosing the apply immediately option can cause unexpected downtime.
When you choose to apply a change immediately, any pending modifications are also applied immediately, instead of during the next maintenance window.
If you don't want a pending change to be applied in the next maintenance
window, you can modify the DB instance to revert the change. You can do this by
using the AWS CLI and specifying the --apply-immediately
option.
Changes to some database settings are applied immediately, even if you choose to defer your changes. To see how the different database settings interact with the apply immediately setting, see Settings for DB instances.
Settings for DB instances
In the following table, you can find details about which settings you can and can't modify, when changes can be applied, and whether the changes cause downtime for your DB instance.
You can modify a DB instance using the console, the
modify-db-instance
CLI command, or the
ModifyDBInstance
RDS API operation.
Console setting and description | CLI option and RDS API parameter | When the change occurs | Downtime notes | Supported DB engines |
---|---|---|---|---|
Allocated storage The storage, in gibibytes, that you want to allocate for your DB instance. You can only increase the allocated storage. You can't reduce the allocated storage. You can't modify the storage of some older DB instances, or DB instances restored from older DB snapshots. The Allocated storage setting is disabled in the console if your DB instance isn't eligible. You can check whether you can allocate more storage by using the CLI command describe-valid-db-instance-modifications. This command returns the valid storage options for your DB instance. You can't modify allocated storage if the DB instance status is storage-optimization or if the allocated storage for the DB instance has been modified in the last six hours. The maximum storage allowed depends on your DB engine and the storage type. For more information, see Amazon RDS DB instance storage. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage doesn't occur during this change. Performance might be degraded during the change. |
All DB engines |
Auto minor version upgrade Yes to enable your DB instance to receive preferred minor DB engine version upgrades automatically when they become available. Amazon RDS performs automatic minor version upgrades in the maintenance window. Otherwise, No. For more information, see Automatically upgrading the minor engine version. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
Only MariaDB, MySQL, Oracle, and PostgreSQL |
Backup retention period The number of days that automatic backups are retained. To disable automatic backups, set the backup retention period to 0. For more information, see Working with backups. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, and you change the setting from a nonzero value to another nonzero value, the change is applied asynchronously, as soon as possible. Otherwise, the change occurs during the next maintenance window. |
An outage occurs if you change from 0 to a nonzero value, or from a nonzero value to 0. |
All DB engines |
Backup window The time range during which automated backups of your databases occur. The backup window is a start time in Universal Coordinated Time (UTC), and a duration in hours. For more information, see Working with backups. |
CLI option:
RDS API parameter:
|
The change is applied asynchronously, as soon as possible. |
An outage doesn't occur during this change. |
All DB engines |
Certificate authority The certificate that you want to use for SSL/TLS connections. For more information, see Using SSL/TLS to encrypt a connection to a DB instance. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage occurs during this change. |
All DB engines |
Copy tags to snapshots If you have any DB instance tags, enable this option to copy them when you create a DB snapshot. For more information, see Tagging Amazon RDS resources. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Database port The port that you want to use to access the DB instance. The port value must not match any of the port values specified for options in the option group that is associated with the DB instance. For more information, see Connecting to an Amazon RDS DB instance. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
The DB instance is rebooted immediately. |
All DB engines |
DB engine version The version of the DB engine that you want to use. Before you upgrade your production DB instance, we recommend that you test the upgrade process on a test DB instance to verify its duration and to validate your applications. For more information, see Upgrading a DB instance engine version. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage occurs during this change. |
All DB engines |
DB instance class The DB instance class that you want to use. For more information, see DB instance classes. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage occurs during this change. |
All DB engines |
DB instance identifier The new DB instance identifier. This value is stored as a lowercase string. For more information about the effects of renaming a DB instance, see Renaming a DB instance. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage occurs during this change. |
All DB engines |
DB parameter group The DB parameter group that you want associated with the DB instance. For more information, see Working with DB parameter groups. |
CLI option:
RDS API parameter:
|
The parameter group change occurs immediately. |
An outage doesn't occur during this change. However, you must manually reboot the DB instance before the new DB parameter group is used by the DB instance. For more information, see Working with DB parameter groups and Rebooting a DB instance. |
All DB engines |
Deletion protection Enable deletion protection to prevent your DB instance from being deleted. For more information, see Deleting a DB instance. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Enhanced Monitoring Enable Enhanced Monitoring to enable gathering metrics in real time for the operating system that your DB instance runs on. For more information, see Enhanced Monitoring. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
IAM DB authentication Enable IAM DB authentication to authenticate database users through IAM users and roles. For more information, see IAM database authentication for MySQL and PostgreSQL. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
A brief outage occurs during this change. |
Only MySQL and PostgreSQL |
Kerberos authentication Choose the Active Directory to move the DB instance to. The directory must exist prior to this operation. If a directory is already selected, you can specify None to remove the DB instance from its current directory. For more information, see Kerberos authentication. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
A brief outage occurs during this change. |
Only Microsoft SQL Server, MySQL, Oracle, and PostgreSQL |
License model Choose bring-your-own-license to use your license for Oracle. Choose license-included to use the general license agreement for Microsoft SQL Server or Oracle. For more information, see Licensing Microsoft SQL Server on Amazon RDS and Oracle licensing options. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage occurs during this change. |
Only Microsoft SQL Server and Oracle |
Log exports The types of database log files to publish to Amazon CloudWatch Logs. For more information, see Publishing database logs to Amazon CloudWatch Logs. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Maintenance window The time range during which system maintenance occurs. System maintenance includes upgrades, if applicable. The maintenance window is a start time in Universal Coordinated Time (UTC), and a duration in hours. If you set the window to the current time, there must be at least 30 minutes between the current time and the end of the window to ensure that any pending changes are applied. For more information, see The Amazon RDS maintenance window. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
If there are one or more pending actions that cause an outage, and the maintenance window is changed to include the current time, those pending actions are applied immediately and an outage occurs. |
All DB engines |
Multi-AZ deployment Yes to deploy your DB instance in multiple Availability Zones. Otherwise, No. For more information, see High availability (Multi-AZ) for Amazon RDS. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage doesn't occur during this change. |
All DB engines |
New master password The password for your master user. The password must contain 8–41 alphanumeric characters. |
CLI option:
RDS API parameter:
|
The change is applied asynchronously, as soon as possible. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Option group The option group that you want associated with the DB instance. For more information, see Working with option groups. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage doesn't occur during this change. |
All DB engines |
Performance Insights Enable Performance Insights to monitor your DB instance load so that you can analyze and troubleshoot your database performance. Performance Insights isn't available for some DB engine versions and DB instance classes. The Performance Insights section doesn't appear in the console if it isn't available for your DB instance. For more information, see Using Amazon RDS Performance Insights. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Performance Insights Master key The AWS KMS key identifier for the customer master key (CMK) for encryption of Performance Insights data. The key identifier is the Amazon Resource Name (ARN), AWS KMS key identifier, or the key alias for the CMK. For more information, see Enabling and disabling Performance Insights. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Performance Insights Retention period The amount of time, in days, to retain Performance Insights data. Valid values are 7 or 731 (2 years). For more information, see Enabling and disabling Performance Insights. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Processor features The number of CPU cores and the number of threads per core for the DB instance class of the DB instance. For more information, see Configuring the processor for a DB instance class. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage occurs during this change. |
Only Oracle |
Provisioned IOPS The new Provisioned IOPS (I/O operations per second) value for the DB instance. The setting is available only if Provisioned IOPS (SSD) is chosen for Storage type. For more information, see Provisioned IOPS SSD storage. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage doesn't occur during this change. |
All DB engines |
Public access Publicly accessible to give the DB instance a public IP address, meaning that it's accessible outside the VPC. To be publicly accessible, the DB instance also has to be in a public subnet in the VPC. Not publicly accessible to make the DB instance accessible only from inside the VPC. For more information, see Hiding a DB instance in a VPC from the internet. To connect to a DB instance from outside of its Amazon VPC, the DB instance must be publicly accessible, access must be granted using the inbound rules of the DB instance's security group, and other requirements must be met. For more information, see Can't connect to Amazon RDS DB instance. If your DB instance is isn't publicly accessible, you can also use an AWS Site-to-Site VPN connection or an AWS Direct Connect connection to access it from a private network. For more information, see Internetwork traffic privacy. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Security group The VPC security group that you want associated with the DB instance. For more information, see Controlling access with security groups. |
CLI option:
RDS API parameter:
|
The change is applied asynchronously, as soon as possible. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Storage autoscaling Enable storage autoscaling to enable Amazon RDS to automatically increase storage when needed to avoid having your DB instance run out of storage space. Use Maximum storage threshold to set the upper limit for Amazon RDS to automatically increase storage for your DB instance. The default is 1,000 GiB. For more information, see Managing capacity automatically with Amazon RDS storage autoscaling. |
CLI option:
RDS API parameter:
|
The change occurs immediately. This setting ignores the apply immediately setting. |
An outage doesn't occur during this change. |
All DB engines |
Storage type The storage type that you want to use. After Amazon RDS begins to modify your DB instance to change the storage size or type, you can't submit another request to change the storage size or type for six hours. For more information, see Amazon RDS storage types. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
The following changes all result in a brief outage while the process starts. After that, you can use your database normally while the change takes place.
|
All DB engines |
Subnet group The subnet group for the DB instance. You can use this setting to move your DB instance to a different VPC. If your DB instance isn't in a VPC, you can use this setting to move your DB instance into a VPC. For more information, see Amazon Virtual Private Cloud VPCs and Amazon RDS. |
CLI option:
RDS API parameter:
|
If you choose to apply the change immediately, it occurs immediately. If you don't choose to apply the change immediately, it occurs during the next maintenance window. |
An outage occurs during this change. |
All DB engines |