Home Ask Login Register

Developers Planet

Your answer is one click away!

LPby February 2016

AWS CLI: get RDS free space

How to get free space of RDS instance using aws-cli?


aws rds describe-db-instances | grep -i 'size|space|free|available|used'

but no result


LPby February 2016

I've found the solution:

STARTTIME="$(date -u -d '5 minutes ago' '+%Y-%m-%dT%T')"
ENDTIME="$(date -u '+%Y-%m-%dT%T')"
aws cloudwatch get-metric-statistics --namespace AWS/RDS \
--metric-name FreeStorageSpace\
--start-time $STARTTIME --end-time $ENDTIME --period 300 \
--statistics Average\
--dimensions="Name=DBInstanceIdentifier, Value=<DB_INSTANCE>"

otput sample:

    "Datapoints": [
            "Timestamp": "2016-02-11T08:50:00Z", 
            "Average": 45698627515.73333, 
            "Unit": "Bytes"
    "Label": "FreeStorageSpace"

Post Status

Asked in February 2016
Viewed 3,837 times
Voted 13
Answered 1 times


Leave an answer

Quote of the day: live life