冷呆獸試驗場

Get Estimated Charge of AWS account

使用AWS帳號時,通常都是到每個月的三、四日時會對前一個月份的費用自動扣款及收到invoice,有沒有辦法更早知道前一個月份的費用金額呢?AWS很體貼的提供了一個方便的功能,就是CloudWatch的預設metric "EstimatedCharges"

以下說明自己在處理這個部份的一些經驗和步驟:

Steps:

  1. In IAM, Create a account with CloudWatch Read Only permission. Download its credential (AccessKey and SecretKey)
  2. Install Amazon CloudWatch Command Line Tool
  3. 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.
  4. After determined the time of record we should get from CloudWatch, use following command to get value:

    mon-get-stats EstimatedCharges --statistics "Maximum" --start-time "2014-08-25T22:00:00Z" --namespace "AWS/Billing" --dimensions "Currency=USD" -I [AccessKey] -S [SecretKey] --region us-east-1
    
  5. Then you should get the amount of charges ( the metric "EstimatedCharges" includes all charges of AWS ).

  6. You can use some script language to automate this action and put it to some scheduled jobs like crontabs.

Note:

  1. The region can only be set to "us-east-1".
  2. Sometimes you will get empty output, please review the start time and retry.
  3. There are some other metrics like EstimatedCharges, please notice the namespace.

Create customized AMI with AWS EBS

標題其實不太好下,基本上就是自行建立好整個作業系統,改完想要修改的設定與服務後,再上傳到AWS上製作出AMI。

Target OS: CentOS 5.5 x86_64

初試ArchLinux

因為小玩具(Eeebox)先前灌的ubuntu 10.04 LTS支援快沒了,加上不知道怎麼搞的,一些套件的相依性整個亂掉了,就萌生了重灌之意。在詢問一些朋友之後,決定來試試看Arch Linux,原因是Eeebox b202的配備不怎麼高級,需要的分支要系統很輕,資源吃很少,而Arch Linux似乎符合這個需求。