I want to create Amazon CloudWatch alarms to monitor my Amazon Relational Database Service (Amazon RDS) DB instance free storage space. I want to prevent the storage-full status.
Resolution
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
To prevent the storage-full status, create an alarm that notifies you when the FreeStorageSpace metric reaches a defined threshold. This helps you prevent downtime that occurs when your RDS DB instance runs out of storage.
Note: Amazon Aurora databases don't have the FreeStorageSpace metric. The following steps apply only to Amazon RDS databases.
To create the CloudWatch alarm, complete the following steps:
- Open the CloudWatch console.
- In the navigation pane, under Alarms, choose All alarms.
- Choose Create alarm, and then choose Select metric.
- Search for the FreeStorageSpace metric.
- Choose RDS, and then choose Per-Database metrics.
- Find the DB instance ID that you want to monitor, and then choose the FreeStorageSpace metric.
- Set the statistic to Minimum and set the period to 1 minute.
- In the Conditions section, configure the threshold. For example, choose Lower/Equal, and then specify the threshold value.
Note: You must specify the value for the parameter in bytes. For example, 10 GB is 10,737,418,240 bytes.
- Choose Next.
- From the Configure actions page, for Alarm state, choose in Alarm.
- From Select an SNS topic, choose Create new topic.
- Enter a topic name. For example, enter rds-storage-alarm.
- For Email endpoints that will receive the notification, enter your email address.
- Choose Create topic. This action sends a confirmation email to the address that you specified.
- Open the email notification that you received from AWS User Notifications, and then choose Confirm subscription.
- Return to the Configure actions page in the CloudWatch console.
- Choose Next.
- Enter a name and description for your alarm, and then choose Next.
- Review the preview of your metric, and then choose Create alarm.
To view the metrics for FreeStorageSpace, complete the following steps:
- Open the Amazon RDS console.
- In the navigation pane, choose Databases.
- Select the name of your database.
- Choose the Monitoring tab.
It's a best practice to create a second, critical alarm for a lower threshold. For example, set your first alarm for 25 GB, and the second critical alarm to 10 GB.
Note: You can also use the AWS CLI or the CloudWatch API to create alarms that monitor storage space.
For more ways to prevent storage-full issues, take the following actions:
If your DB instance storage is already full, then see How do I resolve issues that occur when Amazon RDS DB instances run out of storage?
Related information
Using Amazon CloudWatch alarms
Monitoring metrics in an Amazon RDS instance
Amazon RDS DB instance running out of storage