0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

aws-sdk CostExplorerのgetCostAndUsage関数のパラメーターについてのメモ

Last updated at Posted at 2024-09-01

概要

aws-sdkのCostExplorerのgetCostAndUsage関数のパラメーターについてのメモを記載する。

Granularity

このキーはコスト算出粒度を指定する。
下記のように指定できる。

指定値 粒度
DAILY 指定期間内のコストを日毎に算出
MONTHLY 指定期間内のコストを月ごとに算出
HOURLY 指定期間内のコストを1時間ごとに算出

例えば2024-01-01〜2024-01-31の期間を指定した場合下記の様になる。

  • DAILY:2024-01-01のコスト、2024-01-02のコスト・・・のように31日分の情報が個々に配列に入って返却
  • MONTHLY:2024-01-01〜2024-01-31は2024年1月の一ヶ月以内のコストなので当該期間内のコストの合計が一つ返却
  • HOURLY:2024-01-01 00:00:00〜01:00:00のコスト、2024-01-01 10:00:00〜02:00:00のコスト・・・のようにコストが1時間ごとに分割され配列に入り返却

Metrics

このキーは返す情報の内容を指定している。
下記に一部を記載する。

指定値 内容
UnblendedCost 割引やプロモーションが適用される前のコスト
実際に請求される料金
BlendedCost 複数のアカウントやリージョンにまたがるコストの平均
UsageQuantity 使用量の合計値で例えば、EC2インスタンスの使用時間やS3のストレージ使用量など

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?