Half 1 launched granular value attribution for Amazon Bedrock. This characteristic routinely traces each inference request again to the IAM principal that made the decision. It confirmed how the brand new line_item_iam_principal column may give you per-user and per-application visibility. With elective value allocation tags, you may as well mixture spend by staff, challenge, or tenant utilizing AWS Price Explorer. With this strategy, you possibly can sometimes observe utilization on the granularity you need for any Bedrock-powered service or software, whether or not third-party instruments like Claude Code or Codex or your individual customized builds. This submit exhibits methods to visualize and analyze value attribution for Amazon Bedrock by means of Amazon Athena queries and CUDOS dashboards.
First, this submit exhibits you methods to arrange Price and Utilization Report (CUR) 2.0 by means of Information Exports instrumented with IAM principal knowledge. Subsequent, this submit exhibits you methods to question CUR knowledge with Amazon Athena for evaluation. It then introduces the brand new capabilities of CUDOS dashboards, together with granular Bedrock value and utilization knowledge. Whereas Athena supplies flexibility for aggregations, integration with completely different enterprise intelligence (BI) instruments, and chargeback processes, CUDOS provides pre-built visuals tailor-made to your group’s particular construction.
Instance question output exhibiting Amazon Bedrock prices by IAM principal and utilization kind
Organising Price and Utilization Studies (CUR 2.0)
Earlier than you possibly can analyze Amazon Bedrock prices, arrange a CUR 2.0 knowledge export and join it to Amazon Athena.
Stipulations
You want the next:
- An AWS account with billing console entry.
- IAM permissions for Price and Utilization Studies, S3, and Athena.
- An S3 bucket for CUR knowledge storage.
- Primary familiarity with SQL and the AWS Administration Console.
- (Non-obligatory) Claude Code or Kiro-CLI for automated setup.
Ensure you have the required IAM permissions.
For Amazon Bedrock value attribution, you should allow IAM principal knowledge in your CUR 2.0 export in order that the line_item_iam_principal column and related IAM principal tags are populated.
Making a CUR 2.0 knowledge export with IAM principal knowledge
Observe the directions in Creating a regular knowledge export to arrange your CUR 2.0 export. When configuring the export, ensure that the next choices are a part of your last configuration:
Making a CUR 2.0 normal knowledge export with caller id (IAM principal) allocation knowledge enabled
- In Extra export content material, choose the next checkboxes:
- Embody caller id (IAM principal) allocation knowledge — That is the vital setting that populates the
line_item_iam_principalcolumn and surfaces IAM principal tags (prefixed withiamPrincipal/) in your value knowledge.
- Embody caller id (IAM principal) allocation knowledge — That is the vital setting that populates the
- In Information desk configurations:
- Time granularity: Choose Hourly for max element.
- In Information export supply choices:
- File versioning: Choose Overwrite present report back to keep away from storing duplicate knowledge.
Essential: Enabling IAM principal knowledge will increase CUR file sizes as a result of utilization that was beforehand a single row is now expanded into a number of rows, one for every IAM principal that contributed to the utilization. For prime-volume workloads with many distinct principals, plan your Amazon S3 storage accordingly and take into account Amazon S3 Lifecycle insurance policies for older CUR information.
It could take as much as 24 hours for AWS to ship your first CUR 2.0 report back to the S3 bucket.
Connecting CUR 2.0 to Amazon Athena
With Amazon Athena, you possibly can question your CUR knowledge utilizing normal SQL with no infrastructure to handle. To streamline this setup, an elective agent.md talent repo is out there that you need to use with AI assistants like Claude Code, Kiro-CLI, or Codex. It automates the end-to-end means of connecting your Athena setting to your CUR knowledge.
- Clone the repo (
git clone https://github.com/aws-samples/sample-cur-iam-principal-bedrock-tracking). - Launch Claude Code (
claude) or Kiro CLI (kiro) on this listing. - Immediate: “Learn agent.md and observe its workflow to arrange Price and Utilization Report monitoring and run the Amazon Bedrock-by-principal question for the present month.”
You might also observe the guide setup steps.
In the event you plan to deploy the CUDOS dashboard as nicely, you possibly can deploy it from AWS CloudFormation. This additionally deploys the Athena question database as a part of the method.
As soon as deployed, here’s a pattern check question within the Athena Question Editor that you need to use:
If this returns rows with IAM principal ARNs and Bedrock utilization sorts, your setup is full and prepared for deeper evaluation.
Athena question patterns for Bedrock value monitoring
Along with your CUR 2.0 knowledge accessible in Athena, now you can reply granular value attribution questions utilizing SQL. This part supplies three progressively refined question patterns that cowl the most typical evaluation situations.
Word: Within the following queries, exchange your_cur_table_name with the precise identify of your CUR Athena desk (for instance, cid_data_export.cur2).
Question 1: Bedrock prices by IAM principal and utilization kind
This question supplies a whole breakdown of Amazon Bedrock spending by caller id and mannequin utilization. It solutions the query: “Who is asking which fashions, and the way a lot are they spending?”
Instance output:
| line_item_iam_principal | line_item_usage_type | total_tokens | total_cost |
| arn:aws:sts::123456789012:assumed-role/ChatApp/session-1 | USW2-anthropic.claude-opus-4-8-mantle-cache-write-tokens-standard | 1629.5 | $11.2029 |
| arn:aws:sts::123456789012:assumed-role/DocProcessor/batch-7 | USW2-Claude4.6Sonnet-output-tokens | 68.579 | $1.131 |
| arn:aws:sts::123456789012:assumed-role/ClaudeCode/chat | USW2-Claude4.6Sonnet-cache-write-input-token-count | 831.74 | $3.4309 |
| arn:aws:iam::123456789012:person/alice | USW2-Claude4.6Sonnet-input-tokens | 17.33 | $0.0572 |
Evaluation suggestions:
- Use LIKE patterns corresponding to
line_item_usage_type LIKE '%Sonnetpercentoutput%'or%nova%to filter for particular fashions. - The
line_item_iam_principalcolumn accommodates the complete ARN. For assumed roles, the session identify after the final/identifies the particular person or session.
Question 2: Prices damaged down by recognized IAM principal tags
While you’ve tagged your IAM principals with dimensions like staff, challenge, or costcenter (and activated these tags as value allocation tags), they seem in your CUR 2.0 knowledge as a part of the tags columns, with the iamPrincipal/ prefix adopted by your tag key. This question teams prices by these tags to reply questions like: “How a lot did the engineering staff spend on Bedrock this month?” or “What’s the whole Bedrock value for the chatbot challenge?”
By challenge:
Instance output:
| challenge | line_item_usage_type | total_tokens | total_cost |
| data-science | USW2-Claude4.5Sonnet-cache-write-input-token-count | 433.893 | 1.789808625 |
| data-science | USW2-Claude4.6Sonnet-cache-read-input-token-count | 5372.659 | 1.77297747 |
| engineering | USW2-Claude4.5Sonnet-input-tokens | 29.481 | 0.0972873 |
| engineering | USW2-Claude4.5Sonnet-output-tokens | 31.102 | 0.513183 |
Word: This question returns outcomes provided that your IAM principals have been tagged with the related keys and people tags have been activated as value allocation tags.
Question 3: Dynamic tag discovery utilizing UNNEST for unknown tag schemas
In giant organizations, it’s possible you’ll not know prematurely which tags have been utilized throughout all IAM principals. Totally different groups may use completely different tag keys, or new tags is likely to be launched over time. The next instance exhibits methods to dynamically discover utilizing Athena’s UNNEST operate.
This question discovers all IAM principal tags getting used throughout your Bedrock workloads and exhibits value allocation for every tag key-value pair:
Actual-world use case: Multi-service value comparability
Contemplate a platform staff working a number of AI-powered providers. For instance, the staff may run a doc summarization pipeline (DocProcessor) and a customer-facing chatbot (ChatApp). The staff can assign every service to its personal IAM function. With the question patterns from the previous part, you possibly can isolate how the spend for every service developments with the next question:
Instance output:
| line_item_iam_principal | line_item_usage_type | total_usage | total_cost |
| arn:aws:sts::123456789012:assumed-role/ChatApp/session-1 | USE1-Claude4.6Sonnet-output-tokens | 4,800,000 | $72.00 |
| arn:aws:sts::123456789012:assumed-role/ChatApp/session-1 | USE1-Claude4.6Sonnet-input-tokens | 2,900,000 | $8.70 |
| arn:aws:sts::123456789012:assumed-role/DocProcessor/batch-7 | USE1-NovaLite-output-tokens | 6,100,000 | $1.46 |
| arn:aws:sts::123456789012:assumed-role/DocProcessor/batch-7 | USE1-NovaLite-input-tokens | 3,200,000 | $0.19 |
From this output, the platform staff can reply questions like:
Which software is the highest contributor to this month’s Bedrock spend? On this instance, ChatApp accounts for over $80 utilizing Claude 4.6 Sonnet, whereas DocProcessor prices beneath $5 utilizing Nova Lite.
Might we scale back prices through the use of a unique mannequin for every workload? DocProcessor is already on Nova Lite (applicable for simple summarization duties), however the staff may consider whether or not ChatApp may deal with some interactions with a lighter mannequin to cut back the $72 output-token value.
Price of Athena queries
You pay just for the queries that you simply run. You’re charged based mostly on the quantity of knowledge scanned by every question. The console shows this info after every question, and this info can be accessible within the Latest Queries tab within the Athena console.
Athena queries are billed at $5 per TB scanned (with a ten MB minimal per question). As a result of our desk routinely makes use of hive partition projection on billing_period, queries scoped to a single month solely scan the parquet information in that month’s folder. Scans are sometimes nicely beneath 10 MB, which prices about $0.00005 per question (the ten MB minimal).
To maintain prices low, at all times embody a WHERE billing_period = ... filter and choose solely the columns you want fairly than SELECT *.
The Cloud Intelligence Dashboards framework
CUDOS dashboard is a part of the open supply Cloud Intelligence Dashboards (CID) framework, which you’ll deploy in your AWS account utilizing the supplied infrastructure as code (IaC) templates. The framework helps you drive monetary accountability and improve operational effectivity throughout your AWS organizations. The CUDOS dashboard supplies detailed and actionable insights, supporting data-driven choices for value effectivity throughout your AWS infrastructure.
Amazon Bedrock value and utilization insights in CUDOS
CUDOS model 5.8 introduces a complete Amazon Bedrock part within the AI/ML tab, with full IAM principal value attribution assist. The dashboard supplies:
- Versatile grouping dimensions: Group your Amazon Bedrock spend by IAM Principal, IAM Principal Tags (corresponding to Undertaking or Workforce), Mannequin/Useful resource Group, Area, or some other value taxonomy fields configured throughout dashboard deployment.
- Price-per-million-tokens monitoring: A pattern line overlaid in your spend chart exhibiting how value per million tokens evolves over time, serving to you measure the influence of mannequin choice adjustments or immediate optimization efforts, like caching for instance.
The next determine exhibits the Amazon Bedrock Abstract part within the AI/ML tab of the CUDOS dashboard, grouped by IAM principal, with per-principal value breakdown and cost-per-million-tokens pattern.
CUDOS dashboard exhibiting Amazon Bedrock spend grouped by IAM principal
- Interactive drill-down filtering: Select any worth within the top-level spend chart (corresponding to a particular challenge, principal, or account) and each different visible routinely filters to that choice, letting you drill from a high-level overview into per-model and per-usage-type element with out navigating away from the dashboard.
- Granular mannequin and utilization breakdown: Extra visuals, filtered by the top-level chart, present spend per mannequin, per utilization kind, and cost-per-million-tokens by mannequin, so you possibly can establish which fashions and token sorts are driving prices for a given staff or challenge.
While you change the grouping to IAM Principal Tag Undertaking and select a particular challenge (on this instance, “chatbot-v2”), all different visuals filter to point out solely that challenge’s spend. The visuals break down that spend by mannequin, utilization kind, and unit value developments.
CUDOS dashboard exhibiting Amazon Bedrock spend grouped by IAM principal tag Undertaking, filtered to the chatbot-v2 challenge
With these visuals, you possibly can rapidly reply questions like “Which challenge is driving essentially the most output token prices?”, “Is our chatbot staff utilizing cost-efficient fashions?”, or “How has our value per million tokens modified since we switched from Opus to Sonnet?”, with out writing any SQL.
Getting began with CUDOS
To get began with CUDOS, you possibly can discover the Bedrock part in an interactive demo dashboard. Observe the deployment information to arrange CUDOS in your group.
In the event you’re already utilizing CUDOS, observe the replace steering to improve to model 5.8. It’s also possible to use the add organizational taxonomy so as to add IAM Principal knowledge to your present CUDOS dashboard.
Clear up
First, drop the Athena desk and AWS Glue database (these are metadata, so no compute is working):
Warning: Dropping the Athena desk and Glue database will take away your means to question CUR knowledge. You’ll need to recreate these assets following the previous part if you wish to analyze billing knowledge sooner or later.
Second, for those who not want the fee knowledge itself, disable the export within the AWS Billing and Price Administration console beneath Information Exports and empty the S3 prefix it writes to. Word that is your uncooked billing historical past, so solely delete it for those who’re certain.
Lastly, filter out any Athena question outcomes which have collected:
There aren’t any crawlers, AWS Lambda features, or schedules to delete. Partition projection means the one ongoing value is S3 storage for the CUR information themselves, which is usually pennies per thirty days.
For cleansing up CUDOS, seek advice from the CUDOS dashboard teardown directions.
Conclusion and subsequent steps
This two-part sequence walked by means of a whole toolkit for understanding and managing Amazon Bedrock inference prices:
- Half 1 launched granular value attribution: how Amazon Bedrock routinely captures the IAM principal behind each inference name, and the way you need to use value allocation tags to mixture spend by staff, challenge, or tenant.
- Half 2 (this submit) confirmed you methods to put that knowledge to work: organising CUR 2.0 with IAM principal knowledge, querying value patterns in Amazon Athena, and evaluating spend throughout tasks and principals to tell value allocation choices. It additionally introduces the CUDOS dashboard, which supplies a complete AI/ML sheet with comparable insights for Bedrock.
Activate CUR 2.0 with caller id knowledge within the AWS Billing console, join it to Athena utilizing the supplied agent.md file, and run your first cost-by-principal question. Observe Bedrock adoption throughout your group with the CUDOS dashboard.
In regards to the authors

