
#!/bin/bashĪws cloudwatch get-metric-statistics -namespace AWS/S3 -start-time "$(echo "$now - 86400" | bc)" -end-time "$now" -period 86400 -statistics Average -region $region -metric-name BucketSizeBytes -dimensions Name=BucketName,Value="$bucket" Name=StorageType,Value=StandardStorage Here's a bash script you can use to avoid having to specify -start-date and -end-time manually. All you need to change is the -start-date, -end-time, and Value=. Important: You must specify both StorageType and BucketName in the dimensions argument otherwise you will get no results. aws cloudwatch get-metric-statistics -namespace AWS/S3 -start-time T10:00:00 -end-time T01:00:00 -period 86400 -statistics Average -region eu-west-1 -metric-name BucketSizeBytes -dimensions Name=BucketName,Value= Name=StorageType,Value=StandardStorage

This is much quicker than some of the other commands posted here, as it does not query the size of each file individually to calculate the sum. If you want a GUI, go to the CloudWatch console: (Choose Region > ) Metrics > S3 AWS CLI Command:

As of 28th of July 2015 you can get this information via CloudWatch.
