Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you remove/undo/delete a pending modification on Amazon Aurora RDS?

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.

like image 918
pendo Avatar asked Aug 03 '18 19:08

pendo


People also ask

How long does RDS modification take?

The instance upgrade on the slave usually takes around 10 to 20 minutes, but there is no downtime in this setup.

Which of the following can you use to create and modify an Amazon RDS instance?

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.


2 Answers

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).

Full Example

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.

Check instance class

$ aws rds describe-db-instances --db-instance-identifier database-2-instance-1 | jq '.DBInstances[].DBInstanceClass'
"db.t3.medium"

Validate that there is no pending modification

$ aws rds describe-db-instances --db-instance-identifier database-2-instance-1 | jq '.DBInstances[].PendingModifiedValues'
{}

Modify instance class

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"
}

Validate again

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"
}

Undo modify of instance class

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'
{}

Validate the removed pending modification

$ aws rds describe-db-instances --db-instance-identifier database-2-instance-1 | jq '.DBInstances[].PendingModifiedValues'
{}

At this point the pending modification is gone.

like image 85
malte Avatar answered Oct 12 '22 04:10

malte


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.

like image 8
gileri Avatar answered Oct 12 '22 03:10

gileri