LoginSignup
3
0

More than 1 year has passed since last update.

AWS CLI を利用してコスト配分タグをアクティブ化してみた

Posted at

概要

「AWS コスト配分タグの API を発表」が公開されました.

これまでは、コスト配分タグのアクティブ化と非アクティブ化は、AWS 請求コンソールのコスト配分タグのページから行う必要がありました。今回のサポートにより、ListCostAllocationTags の API を使用して全てのタグを一覧表示し、UpdateCostAllocationTagsStatus の API を使用してコスト配分タグのアクティブ化と非アクティブ化できるようになりました。

コンソールを介さずに使用できるそうです

環境

aws-cli/2.7.7 Python/3.9.11 Windows/10 exe/AMD64 prompt/off

※ 新しく追加されたAPIのため, 更新が必要そう

手順

  1. 現状の設定を取得する

    aws ce list-cost-allocation-tags > before.json
    
  2. 設定を更新する

    aws ce update-cost-allocation-tags-status --cost-allocation-tags-status TagKey={TAG_KEY},Status={Active|Inactive}
    
  3. 設定が反映されたか確認する

    aws ce list-cost-allocation-tags > after.json
    
  4. before.json と after.json を比較し, 意図した設定が反映されていることを確認する

3
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
3
0