How do I find the total size of my AWS S3 storage bucket or folder?

前端 未结 10 1971
醉梦人生
醉梦人生 2020-12-09 00:48

Does Amazon provide an easy way to see how much storage my S3 bucket or folder is using? This is so I can calculate my costs, etc.

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 01:26

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

    aws cloudwatch get-metric-statistics --namespace AWS/S3 --start-time 2015-07-15T10:00:00 
    --end-time 2015-07-31T01:00:00 --period 86400 --statistics Average --region us-east-1 
    --metric-name BucketSizeBytes --dimensions Name=BucketName,Value=myBucketNameGoesHere 
    Name=StorageType,Value=StandardStorage
    
    
    Important: You must specify both StorageType and BucketName in the dimensions argument otherwise you will get no results.
    

提交回复
热议问题