I was pegging the 90 total connections allowed on my Aurora RDS instance, now that I've got a few more heavy duty sites than I had before. I decided to upgrade the instance and I did so, but put the upgrade as pending until the next maintenance window, without considering adding a read-only replica into the cluster. I've added the replica and all is well. I want to cancel that pending upgrade from a db.t2.medium Aurora to a db.r3.large Aurora instance. I can't find a way to clear out the pending modifications queue.
I have the AWS CLI installed and config'd. I just can't find documentation on flushing out the pending modifications queue. Thanks to all in advance.
The instance upgrade on the slave usually takes around 10 to 20 minutes, but there is no downtime in this setup.
You can modify a DB instance using the console, the modify-db-instance CLI command, or the ModifyDBInstance RDS API operation. The storage, in gibibytes, that you want to allocate for your DB instance.
As @gileri described, there is now a way to undo a pending modification.
I tested it multiple times with RDS/Aurora instances and it works as expected, even without the --apply-immediately
parameter (at least for the instance class modifications).
Let's change the instance class for an Aurora instance called database-2-instance-1
from db.t3.medium
to db.r4.large
and undo it again afterwards. None of these commands do impact the availability of the database.
Note: Using jq
here to only output the important parts.
$ aws rds describe-db-instances --db-instance-identifier database-2-instance-1 | jq '.DBInstances[].DBInstanceClass'
"db.t3.medium"
$ aws rds describe-db-instances --db-instance-identifier database-2-instance-1 | jq '.DBInstances[].PendingModifiedValues'
{}
This modification will result in a change of the instance class in the next maintenance window.
$ aws rds modify-db-instance --db-instance-identifier database-2-instance-1 --db-instance-class db.r4.large | jq '.DBInstance.PendingModifiedValues'
{
"DBInstanceClass": "db.r4.large"
}
Just to be sure, check if everything looks as expected.
$ aws rds describe-db-instances --db-instance-identifier database-2-instance-1 | jq '.DBInstances[].PendingModifiedValues'
{
"DBInstanceClass": "db.r4.large"
}
This is the important part which modifies the instance class back to the old value. The documentation describes that a --apply-immediately
is required, but it turns out that that is not the case. At least in this example.
$ aws rds modify-db-instance --db-instance-identifier database-2-instance-1 --db-instance-class db.t3.medium | jq '.DBInstance.PendingModifiedValues'
{}
$ aws rds describe-db-instances --db-instance-identifier database-2-instance-1 | jq '.DBInstances[].PendingModifiedValues'
{}
At this point the pending modification is gone.
Since February 2019, it is documented that you can cancel such pending modifications. I have tested this with a pending DB instance class modification.
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 using the AWS CLI and specify the --apply-immediately option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With