aws cli - AWS CLI: get RDS free space -
how free space of rds instance using aws-cli?
tried:
aws rds describe-db-instances | grep -i 'size|space|free|available|used'
but no result
i've found 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" }
Comments
Post a Comment