- In IAM, Create a account with CloudWatch Read Only permission. Download its credential (AccessKey and SecretKey)
- Install Amazon CloudWatch Command Line Tool
- The time of Lastest value of metric EstimatedCharges differs from the Real time in GMT+8 is about 14 hours ( include 8 hours timezone difference ). Additional 6 hours should be buffered by AWS.
After determined the time of record we should get from CloudWatch, use following command to get value:
Then you should get the amount of charges ( the metric "EstimatedCharges" includes all charges of AWS ).
You can use some script language to automate this action and put it to some scheduled jobs like crontabs.
- The region can only be set to "us-east-1".
- Sometimes you will get empty output, please review the start time and retry.
- There are some other metrics like EstimatedCharges, please notice the namespace.