Increase Amazon RDS Storage Size using AWS CLI

You might have encountered AWS RDS storage full situation for your RDS instance. To overcome this situation you can increase or scale up the storage using Amazon RDS console or else using the Command Line Interface -AWS CLI.

Scaling storage usually don’t cause any database outage but after storage size modification, the status of the DB instance will be storage-optimization.

Storage optimization can take upto several hours and you can’t make further storage modification either for six hours or until storage modification has been completed on the instance, whichever is longer.

Related Article: No space left on device in Amazon Aurora for PostgreSQL

Note: –allocated-storage size must be at least 10% greater than the existing storage size. If you increase the storage size which is less than 10% of your current storage size then you will get an error. To avoid further storage crunch, you can increase the storage size by 25% more than the existing size.

Command to increase AWS RDS Storage Size

aws rds modify-db-instance \
    --db-instance-identifier ora-dev-db02 \
    --allocated-storage 200 \
    --apply-immediately

Note: If max storage size is enabled then include max-allocated-storage value and allocated-storage value both in the above command. Max allocated storage value must be greater than allocated storage value.
--max-allocated-storage (integer): The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale the storage of the DB instance.

Here the allocated and max storage size is in GiB. Please note that once the storage has been increased or allocated, you can’t reduce the storage size of your DB instance.

AWS CLI Command Reference: https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html