Amazon Bedrockの詳細なコスト帰属機能の導入
AWSはAmazon Bedrockの推論コストをIAMプリンシパル単位で自動的に属性付与する詳細なコスト配分機能を発表し、クラウドAIコストの可視化と管理を強化した。
キーポイント
詳細なコスト属性付与の導入
Amazon Bedrockの推論コストをIAMプリンシパル(ユーザー、ロール、フェデレーティッドID)単位で自動的に追跡し、AWS請求に反映する機能が追加された。
ワークフロー変更不要の実装
既存のワークフローを変更せず、追加リソース管理も不要で、すべてのモデルにわたって機能する。
コスト割り当てタグによる集計
オプションのコスト割り当てタグを使用して、チーム、プロジェクト、カスタム次元ごとにAWS Cost ExplorerとCUR 2.0でコストを集計できる。
具体的なデータ表示例
CUR 2.0でIAMプリンシパルごとの呼び出しと支出を確認でき、例としてAliceとBobのユーザーごとのトークン使用コストが示されている。
CUR 2.0による詳細なコスト分析
Cost and Usage Report (CUR 2.0)は、IAMプリンシパル(ユーザーまたはロール)、使用タイプ(リージョン・モデル・トークン方向)、タグの3つの次元でコストを分析可能。これによりユーザー別、モデル別、チーム別の詳細なコスト分析ができる。
APIキー使用時のコスト帰属
Amazon Bedrock APIキーを使用した場合も、APIキーはIAMプリンシパルに関連付けられており、リクエストは対応するIAMアイデンティティに帰属される。これによりAPIキーを配布する組織でもコスト追跡が可能。
IAMロールによるアプリケーション別コスト追跡
本番ワークロードでは、アプリケーションがIAMロールを引き受けてAmazon Bedrockを呼び出すことで、CUR 2.0レポートでアプリケーション別のコスト可視化が可能。ロールにタグを付けることでプロジェクトやコストセンター別の集計もできる。
重要な引用
As AI inference grows into a significant share of cloud spend, understanding who and what are driving costs is essential for chargebacks, cost optimization, and financial planning.
Amazon Bedrock now automatically attributes inference costs to the IAM principal that made the call.
Attribution flows to your AWS Billing and works across models, with no resources to manage and no changes to your existing workflows.
The Cost and Usage Report captures both the individual user identity and their tags, giving you two dimensions for analysis
Requests made with API keys are attributed to the corresponding IAM identities, so the same line_item_iam_principal and tag-based attribution applies
When app-1 assumes Role-1 and calls Amazon Bedrock, the request is attributed to the assumed-role session. The role’s tags flow through to billing automatically.
影響分析・編集コメントを表示
影響分析
この機能は、AI推論コストがクラウド支出の重要な部分を占めるようになる中で、企業の財務管理とコスト最適化を支援する。特に大規模なAI導入企業にとって、部門やプロジェクト単位でのコスト配分と責任の明確化に貢献し、AI投資のROI向上につながる可能性がある。
編集コメント
AWSのAIサービスエコシステムの成熟度を示す実用的なアップデート。企業のAI導入が本格化する中で、コスト管理の重要性が高まっていることを反映している。
AI の推論がクラウド支出の大きな割合を占めるようになる中、コストを誰が・何が駆動しているかを理解することは、請求配分、コスト最適化、および財務計画において不可欠です。本日、Amazon Bedrock 推論に対する詳細なコスト帰属を発表します。
Amazon Bedrock は現在、呼び出しを行った IAM プリンシパルに対して推論コストを自動的に帰属します。IAM プリンシパルには、IAM ユーザー、アプリケーションが引き受けるロール、Okta や Entra ID などのプロバイダーからのフェデレーテッドアイデンティティが含まれます。帰属は AWS の請求書に流れ、モデル全体で機能し、管理すべきリソースも既存のワークフローの変更も不要です。オプションのコストアロケーションタグを使用することで、AWS Cost Explorer および AWS コストと使用状況レポート (CUR 2.0) でチーム、プロジェクト、またはカスタム次元ごとにコストを集計できます。
本稿では、Amazon Bedrock の詳細なコスト帰属の仕組みについて解説し、例示されるコスト追跡シナリオを順を追って説明します。
詳細なコスト帰属の仕組み
CUR 2.0において、データエクスポート設定で IAM プリンシパルデータを有効にすると、Amazon Bedrock を呼び出している AWS Identity and Access Management (IAM) プリンシパルと、それぞれが支出している金額を確認できます。以下はその例です:
line_item_iam_principal
line_item_usage_type
line_item_unblended_cost
arn:aws:iam::123456789012:user/alice
USE1-Claude4.6Sonnet-input-tokens(入力トークン)
$0.069
arn:aws:iam::123456789012:user/alice
USE1-Claude4.6Sonnet-output-tokens(出力トークン)
$0.214
arn:aws:iam::123456789012:user/bob
USE1-Claude4.6Opus-input-tokens(入力トークン)
$0.198
arn:aws:iam::123456789012:user/bob
USE1-Claude4.6Opus-output-tokens(出力トークン)
$0.990
Here, you can see that Alice is using Claude 4.6 Sonnet and Bob is using Claude 4.6 Opus, and what each is spending in input and output tokens. The following table shows what the line_item_iam_principal column contains for each identity type:
How you call Amazon Bedrock Inference
line_item_iam_principal
AWS IAM User(AWS IAM ユーザー)
…user/alice
Bedrock key (maps to IAM User)(Bedrock キー:IAM ユーザーにマッピング)
…user/BedrockAPIKey-234s
AWS IAM Role (e.g. AWS Lambda function)(AWS IAM ロール:例として AWS Lambda 関数)
…assumed-role/AppRole/session
Federated User (e.g. from an identity provider)(フェデレーションユーザー:例として ID プロバイダーからのもの)
…assumed-role/Role/user@acme.org
Adding tags for aggregation and Cost Explorer
To aggregate costs by team, project, or cost center, add tags to your IAM principals. Tags flow to your billing data in two ways:
- プリンシパルタグは、IAM ユーザーまたはロールに直接付与されます。一度設定すると、そのプリンシパルからのすべてのリクエストに適用されます。
- セッションタグは、ユーザーまたはアプリケーションが IAM ロールを想定して一時的な認証情報を取得する際や、ID プロバイダーの主張(アサーション)に埋め込まれる際に動的に渡されます。詳細については、「AWS STS でのセッションタグの転送」をご覧ください。
AWS Billing で コスト配分タグ として有効化された後、両方のタグタイプは CUR 2.0 の tags カラムに iamPrincipal/ プレフィックス付きで表示されます。以下に例を示します:
| Bedrock の呼び出し元 | line_item_iam_principal | tags |
|---|---|---|
| AWS IAM User | …user/alice | {"iamPrincipal/team":"ds"} |
| AWS IAM Role | …assumed-role/AppRole/session | {"iamPrincipal/project":"chatbot"} |
| Federated User | …assumed-role/Role/user@acme.org | {"iamPrincipal/team":"eng"} |
コスト配分戦略の構築に関する詳細なガイダンスについては、AWS リソースのタグ付けに関するベストプラクティス をご覧ください。
シナリオ別クイックスタート
ユーザーやアプリケーションが Amazon Bedrock を呼び出す方法によって、セットアップは異なります。以下の表では、各アクセスパターンで CUR 2.0 で利用可能な帰属情報と、タグベースの集計のために設定すべき内容を要約しています:
あなたのセットアップ
CUR 2.0 のアトリビューション
集約と Cost Explorer 用のタグ追加方法
シナリオ
IAM ユーザーまたは API キーを持つ開発者
CUR 2.0 には各ユーザーの ARN が表示されます
IAM ユーザーにタグを付与する
1
IAM ロールを持つアプリケーション
CUR 2.0 には各ロールの ARN が表示されます
IAM ロールにタグを付与する
2
IdP を介して認証を行うユーザー
ARN のセッション名でユーザーが識別される
セッション名とタグを IdP から渡す
3
Bedrock にプロキシする LLM ゲートウェイ
すべてのユーザーに対してゲートウェイのロール(1 つのアイデンティティ)のみが表示される
ユーザーごとの AssumeRole をセッション名とタグ付きで追加する
4
注: シナリオ 1~3 では、CUR 2.0 の line_item_iam_principal カラムにより、呼び出し元ごとのアイデンティティアトリビューションが得られます。カスタム次元(チーム、コストセンター、テナント)での集約や、Cost Explorer を用いた視覚的分析・アラート設定を希望する場合にのみタグが必要です。シナリオ 4 では、ユーザーレベルのアトリビューションを得るためにユーザーごとのセッション管理が必須です。これがないと、トラフィックはゲートウェイの単一ロールに対してアトリビュートされます。
タグを追加した後、AWS Billing コンソールまたは UpdateCostAllocationTagsStatus API を使用して コスト配分タグを有効化 してください。タグは Cost Explorer および CUR 2.0 に 24~48 時間以内に反映されます。
以下のセクションでは、いくつかの一般的なシナリオについて詳しく解説します。
シナリオ 1: IAM ユーザーと API キーを使用したユーザーごとの追跡
ユースケース: 個別の開発者が IAM ユーザー資格情報または Amazon Bedrock API キーを使用する小規模チーム、開発環境、あるいは迅速なプロトタイピング。
仕組み:
各チームメンバーには、長期有効期限を持つ専用 IAM ユーザーが割り当てられています。例えば user-1 または user-2 が Amazon Bedrock を呼び出すと、Amazon Bedrock は認証時にその IAM ユーザーの Amazon Resource Name (ARN) を自動的にキャプチャします。CUR 2.0 では、誰がどの程度の費用を支出しているかが確認できます。
チーム、コストセンター、あるいは他の次元(例えばデータサイエンスチームメンバー全体の総支出など)でコストを集計したい場合は、IAM ユーザーにタグを付与してください。タグは IAM コンソール、AWS Command Line Interface (AWS CLI)、または AWS API を使用して追加できます。以下の例では AWS CLI を使用しています:
データサイエンスチームのユーザーにタグを付与
aws iam tag-user \
--user-name user-1 \
--tags Key=team,Value="BedrockDataScience" Key=cost-center,Value="12345"
aws iam tag-user \
--user-name user-2 \
--tags Key=team,Value="BedrockDataScience" Key=cost-center,Value="12345"
CUR 2.0 に表示される内容:
Cost and Usage Report は、個別のユーザーIDとそのタグの両方をキャプチャするため、以下に示す例のように分析のための 2 つの次元を提供します:
line_item_iam_principal
line_item_usage_type
line_item_unblended_cost
tags
arn:aws:iam::123456789012:user/user-1
USE1-Claude4.6Sonnet-input-tokens
$0.0693
{"iamPrincipal/team":"BedrockDataScience","iamPrincipal/cost-center":"12345"}
arn:aws:iam::123456789012:user/user-1
USE1-Claude4.6Sonnet-output-tokens
$0.2145
{"iamPrincipal/team":"BedrockDataScience","iamPrincipal/cost-center":"12345"}
arn:aws:iam::123456789012:user/user-2
USE1-Claude4.6Opus-input-tokens
$0.1980
{"iamPrincipal/team":"BedrockDataScience","iamPrincipal/cost-center":"12345"}
arn:aws:iam::123456789012:user/user-2
USE1-Claude4.6Opus-output-tokens
$0.9900
{"iamPrincipal/team":"BedrockDataScience","iamPrincipal/cost-center":"12345"}
line_item_usage_type カラムには、リージョン、モデル、トークンの方向(入力 vs 出力)がエンコードされているため、「ユーザー 1 は Sonnet の入力トークンと出力トークンでそれぞれいくら使ったか?」や「Opus と Sonnet を誰が利用しているか?」といった質問に回答できます。
このデータから、コストを複数の観点で分析することができます:
- ユーザー別:line_item_iam_principal でフィルタリングして、各人が実際にいくら支出したかを確認できます。これは、リソースを大量に使用するユーザーの特定や、個人の実験にかかるコストを追跡する際に役立ちます。
- モデル別:line_item_usage_type でフィルタリングして、モデルごとの支出を比較できます。例えば、Opus のコストを主導しているのは誰で、Sonnet のコストは誰が負担しているかを確認できます。
- チーム別:iamPrincipal/team でグループ化して、データサイエンスチームメンバー全体の総支出を確認できます。これは部署間の費用配分(チャージバック)に有用です。
このアプローチは、ユーザー数が管理可能な範囲であり、最もシンプルなセットアップを望む場合に最適です。各ユーザーの認証情報は、請求書上で直接その個人を識別するために使用され、タグを用いることでコストをより上位の次元に集約できます。
Amazon Bedrock API キーの使用: Amazon Bedrock は、他の AI プロバイダーと同様に、簡素な認証体験を提供する API キー もサポートしています。API キーは IAM プリンシパルに関連付けられており、API キーを使用して行われたリクエストは対応する IAM アイデンティティに帰属します。そのため、line_item_iam_principal やタグベースの帰属処理がそのまま適用されます。つまり、開発者に API キーを配布したりアプリケーションに埋め込んだりする組織であっても、コストを発生源である IAM ユーザーまたはロールまで遡って追跡することが可能です。
シナリオ 2: IAM ロールによるアプリケーションごとの追跡
ユースケース: アプリケーション(人間ではなく)が Amazon Bedrock を呼び出す本番環境ワークロードで、プロジェクトやサービスごとにコストを追跡したい場合。
仕組み:
ドキュメント処理サービス (app-1) やチャットサービス (app-2) などの 2 つのバックエンドアプリケーションがあるとします。各アプリケーションは、Amazon EC2、AWS Lambda、Amazon Elastic Container Service (Amazon ECS) などのコンピューティングインフラストラクチャ上で実行され、Amazon Bedrock を呼び出すために専用の IAM ロールを仮定します。いずれかのアプリケーションが Amazon Bedrock を呼び出すと、仮定されたロールの ARN が自動的にキャプチャーされます。この帰属情報は CUR 2.0 レポートに流れ込み、アプリケーションごとのコスト可視化を提供します。
line_item_iam_principal(ロール名を含む)でフィルタリングして各アプリケーションの総支出を確認するか、line_item_usage_type でフィルタリングしてサービス間のモデル使用状況を比較することもできます。タグはオプションです。アプリケーションがリクエストまたはバッチジョブごとに一意のセッション名を生成する場合は、より細かなレベルの詳細でコストを追跡できます。
プロジェクト、コストセンター、または別の次元(例えば、DocFlow と ChatBackend 間の総支出を比較するなど)でコストを集計したい場合は、IAM ロールにタグを付与します:
ドキュメント処理ロールへのタグ付け
aws iam tag-role \
--role-name Role-1 \
--tags Key=project,Value="DocFlow" Key=cost-center,Value="12345"
チャットサービスロールへのタグ付け
aws iam tag-role \
--role-name Role-2 \
--tags Key=project,Value="ChatBackend" Key=cost-center,Value="12345"
app-1 が Role-1 を仮定して Amazon Bedrock を呼び出すと、リクエストは仮定されたロールのセッションに帰属されます。ロールのタグは自動的に請求情報にも反映されます。
CUR 2.0 に表示される内容:
line_item_iam_principal フィールドには、セッション名を含む仮定ロールの完全な ARN が表示されます。以下に例を示します:
line_item_iam_principal
line_item_usage_type
line_item_unblended_cost
tags
arn:aws:sts::123456789012:assumed-role/Role-1/session-123
USE1-Claude4.6Sonnet-input-tokens
$0.0330
{"iamPrincipal/project":"DocFlow","iamPrincipal/cost-center":"12345"}
arn:aws:sts::123456789012:assumed-role/Role-1/session-123
USE1-Claude4.6Opus-output-tokens
$0.1650
{"iamPrincipal/project":"DocFlow","iamPrincipal/cost-center":"12345"}
arn:aws:sts::123456789012:assumed-role/Role-2/session-456
USE1-NovaLite-input-tokens
$0.0810
{{"iamPrincipal/project":"ChatBackend","iamPrincipal/cost-center":"12345"}
arn:aws:sts::123456789012:assumed-role/Role-2/session-456
USE1-NovaLite-output-tokens
$0.0500
{"iamPrincipal/project":"ChatBackend","iamPrincipal/cost-center":"12345"}
これにより、複数の分析オプションが利用可能になります:
- ロールでフィルタリング:ARN のロール名部分を使用して、各アプリケーションの総支出額を確認できます。
- セッションでフィルタリング:セッション名を使用して、リクエストごとまたはバッチジョブごとのコストを追跡できます。
プロジェクトごとに集計: G
原文を表示
As AI inference grows into a significant share of cloud spend, understanding who and what are driving costs is essential for chargebacks, cost optimization, and financial planning. Today, we’re announcing granular cost attribution for Amazon Bedrock inference.
Amazon Bedrock now automatically attributes inference costs to the IAM principal that made the call. An IAM principal can be an IAM user, a role assumed by an application, or a federated identity from a provider like Okta or Entra ID. Attribution flows to your AWS Billing and works across models, with no resources to manage and no changes to your existing workflows. With optional cost allocation tags, you can aggregate costs by team, project, or custom dimension in AWS Cost Explorer and AWS Cost and Usage Reports (CUR 2.0).
In this post, we share how Amazon Bedrock’s granular cost attribution works and walk through example cost tracking scenarios.
How granular cost attribution works
In your CUR 2.0, you can see which AWS Identity and Access Management (IAM) principals are calling Amazon Bedrock and what each is spending when you enable IAM principal data in your data export configuration, as shown in the following example:
line_item_iam_principal
line_item_usage_type
line_item_unblended_cost
arn:aws:iam::123456789012:user/alice
USE1-Claude4.6Sonnet-input-tokens
$0.069
arn:aws:iam::123456789012:user/alice
USE1-Claude4.6Sonnet-output-tokens
$0.214
arn:aws:iam::123456789012:user/bob
USE1-Claude4.6Opus-input-tokens
$0.198
arn:aws:iam::123456789012:user/bob
USE1-Claude4.6Opus-output-tokens
$0.990
Here, you can see that Alice is using Claude 4.6 Sonnet and Bob is using Claude 4.6 Opus, and what each is spending in input and output tokens. The following table shows what the line_item_iam_principal column contains for each identity type:
How you call Amazon Bedrock Inference
line_item_iam_principal
AWS IAM User
…user/alice
Bedrock key (maps to IAM User)
…user/BedrockAPIKey-234s
AWS IAM Role (e.g. AWS Lambda function)
…assumed-role/AppRole/session
Federated User (e.g. from an identity provider)
…assumed-role/Role/user@acme.org
Adding tags for aggregation and Cost Explorer
To aggregate costs by team, project, or cost center, add tags to your IAM principals. Tags flow to your billing data in two ways:
- Principal tags are attached directly to IAM users or roles. Set them once and they apply to every request from that principal.
- Session tags are passed dynamically when a user or application assumes an IAM role to obtain temporary credentials or embedded in identity provider assertions. To learn more, see Passing session tags in AWS STS.
After activation as cost allocation tags in AWS Billing, both tag types appear in the tags column of CUR 2.0 with the iamPrincipal/ prefix, as shown in the following example:
How you call Bedrock
line_item_iam_principal
tags
AWS IAM User
…user/alice
{“iamPrincipal/team”:”ds”}
AWS IAM Role
…assumed-role/AppRole/session
{“iamPrincipal/project”:”chatbot”}
Federated User
…assumed-role/Role/user@acme.org
{“iamPrincipal/team”:”eng”}
For more guidance on building a cost allocation strategy, see Best Practices for Tagging AWS Resources.
Quickstart by scenario
Your setup depends on how your users and applications call Amazon Bedrock. The following table summarizes the attribution available in CUR 2.0 for each access pattern and what to configure for tag-based aggregation:
Your setup
CUR 2.0 attribution
How to add tags for aggregation + Cost Explorer
Scenario
Developers with IAM users or API keys
Each user’s ARN appears in CUR 2.0
Attach tags to IAM users
1
Applications with IAM roles
Each role’s ARN appears in CUR 2.0
Attach tags to IAM roles
2
Users authenticate through an IdP
session name in ARN identifies users
Pass session name and tags from your IdP
3
LLM gateway proxying to Bedrock
Only shows gateway’s role (one identity for all users)
Add per-user AssumeRole with session name and tags
4
Note: For Scenarios 1–3, the line_item_iam_principal column in CUR 2.0 gives you per-caller identity attribution. Tags are only needed if you want to aggregate by custom dimensions (team, cost center, tenant) or use Cost Explorer for visual analysis and alerts. For Scenario 4, per-user session management is required to get user-level attribution. Without it, traffic is attributed to the gateway’s single role.
After adding tags, activate your cost allocation tags in the AWS Billing console or via UpdateCostAllocationTagsStatus API. Tags appear in Cost Explorer and CUR 2.0 within 24–48 hours.
The following sections walk through a few common scenarios.
Scenario 1: Per-user tracking with IAM users and API keys
Use case: Small teams, development environments, or rapid prototyping where individual developers use IAM user credentials or Amazon Bedrock API keys.
How it works:
Each team member has a dedicated IAM user with long-term credentials. When either user-1 or user-2, for example, calls Amazon Bedrock, Amazon Bedrock automatically captures their IAM user Amazon Resource Name (ARN) during authentication. Your CUR 2.0 shows who is spending what.
If you want to roll up costs by team, cost center, or another dimension — for example, to see total spend across data science team members — attach tags to your IAM users. You can add tags in the IAM console, AWS Command Line Interface (AWS CLI), or the AWS API. The following example uses the AWS CLI:
# Tag the data science team's users
aws iam tag-user \
--user-name user-1 \
--tags Key=team,Value="BedrockDataScience" Key=cost-center,Value="12345"
aws iam tag-user \
--user-name user-2 \
--tags Key=team,Value="BedrockDataScience" Key=cost-center,Value="12345"What appears in CUR 2.0:
The Cost and Usage Report captures both the individual user identity and their tags, giving you two dimensions for analysis as shown in the following example:
line_item_iam_principal
line_item_usage_type
line_item_unblended_cost
tags
arn:aws:iam::123456789012:user/user-1
USE1-Claude4.6Sonnet-input-tokens
$0.0693
{“iamPrincipal/team”:”BedrockDataScience”,”iamPrincipal/cost-center”:”12345″}
arn:aws:iam::123456789012:user/user-1
USE1-Claude4.6Sonnet-output-tokens
$0.2145
{“iamPrincipal/team”:”BedrockDataScience”,”iamPrincipal/cost-center”:”12345″}
arn:aws:iam::123456789012:user/user-2
USE1-Claude4.6Opus-input-tokens
$0.1980
{“iamPrincipal/team”:”BedrockDataScience”,”iamPrincipal/cost-center”:”12345″}
arn:aws:iam::123456789012:user/user-2
USE1-Claude4.6Opus-output-tokens
$0.9900
{“iamPrincipal/team”:”BedrockDataScience”,”iamPrincipal/cost-center”:”12345″}
The line_item_usage_type column encodes the region, model, and token direction (input vs. output), so you can answer questions like “How much did user-1 spend on Sonnet input tokens vs. output tokens?” or “Who’s using Opus vs. Sonnet?”
From this data, you can analyze costs in several ways:
- By user: Filter on line_item_iam_principal to see exactly how much each person spent. This is useful for identifying heavy users or tracking individual experimentation costs.
- By model: Filter on line_item_usage_type to compare per-model spend, for example, who’s driving Opus costs vs. Sonnet.
- By team: Group by iamPrincipal/team to see total spend across data science team members. This is useful for departmental chargeback.
This approach is ideal when you have a manageable number of users and want the simplest possible setup. Each user’s credentials directly identify them in billing, and tags let you roll up costs to higher-level dimensions.
Using Amazon Bedrock API keys: Amazon Bedrock also supports API keys for a simplified authentication experience similar to other AI providers. API keys are associated with IAM principals. Requests made with API keys are attributed to the corresponding IAM identities, so the same line_item_iam_principal and tag-based attribution applies. This means organizations distributing API keys to developers or embedding them in applications can still track costs back to the originating IAM user or role.
Scenario 2: Per-application tracking with IAM roles
Use case: Production workloads where applications (not humans) call Amazon Bedrock, and you want to track costs by project or service.
How it works:
You have two backend applications, for example, a document processing service (app-1) and a chat service (app-2). Each application runs on compute infrastructure (Amazon EC2, AWS Lambda, Amazon Elastic Container Service (Amazon ECS), etc.) and assumes a dedicated IAM role to call Amazon Bedrock. When either application calls Amazon Bedrock, the assumed-role ARN is automatically captured. This attribution flows to your CUR 2.0 report, giving you per-application cost visibility.
You can filter by line_item_iam_principal, which contains the role name, to see total spend per application, or by line_item_usage_type to compare model usage across services. Tags are optional. If your application generates unique session names per request or batch job, you can track costs at an even finer level of detail.
If you want to roll up costs by project, cost center, or another dimension — for example, to compare total spend across DocFlow vs. ChatBackend — attach tags to the IAM roles:
# Tag the document processing role
aws iam tag-role \
--role-name Role-1 \
--tags Key=project,Value="DocFlow" Key=cost-center,Value="12345"
# Tag the chat service role
aws iam tag-role \
--role-name Role-2 \
--tags Key=project,Value="ChatBackend" Key=cost-center,Value="12345"When app-1 assumes Role-1 and calls Amazon Bedrock, the request is attributed to the assumed-role session. The role’s tags flow through to billing automatically.
What appears in CUR 2.0:
The line_item_iam_principal shows the full assumed-role ARN including the session name, as shown in the following example:
line_item_iam_principal
line_item_usage_type
line_item_unblended_cost
tags
arn:aws:sts::123456789012:assumed-role/Role-1/session-123
USE1-Claude4.6Sonnet-input-tokens
$0.0330
{“iamPrincipal/project”:”DocFlow”,”iamPrincipal/cost-center”:”12345″}
arn:aws:sts::123456789012:assumed-role/Role-1/session-123
USE1-Claude4.6Opus-output-tokens
$0.1650
{“iamPrincipal/project”:”DocFlow”,”iamPrincipal/cost-center”:”12345″}
arn:aws:sts::123456789012:assumed-role/Role-2/session-456
USE1-NovaLite-input-tokens
$0.0810
{{“iamPrincipal/project”:”ChatBackend”,”iamPrincipal/cost-center”:”12345″}
arn:aws:sts::123456789012:assumed-role/Role-2/session-456
USE1-NovaLite-output-tokens
$0.0500
{“iamPrincipal/project”:”ChatBackend”,”iamPrincipal/cost-center”:”12345″}
This gives you multiple analysis options:
- Filter by role: See total spend per application using the role name portion of the ARN.
- Filter by session: Track costs per request or batch job using the session name.
Aggregate by project: G
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み