Amazon Bedrock now records the calling IAM principal for every inference request, and AWS offers a straight‑through workflow that ties those records to cost allocation tags, CUR 2.0 exports, and budget actions. Engineers can therefore see per‑identity spend and automatically block further usage once a threshold is reached, all without writing custom Lambda logic.
Bedrock Cost Attribution
Attribute. Bedrock automatically logs the IAM user or role that initiates each model call. If multiple people share a role, you can enrich the request with session tags at assume‑role time; otherwise, static principal tags on the role are sufficient. No changes to the inference API are required.
Reporting Options
Report. Activate the principal‑related tags as cost allocation tags in the billing console. Once active, the tags appear in Cost Explorer, where you can filter and group by identity. For deeper analysis, enable a CUR 2.0 data export to an S3 bucket and query the line‑item files with Athena or any SQL engine. The export includes the Bedrock service code, usage quantity, and the attached principal tag, giving a granular spend ledger.
Enforcement Mechanics
Enforce. Create an AWS Budget scoped to the Amazon Bedrock service and filtered to a specific principal tag value. Attach a budget action that applies a Deny IAM policy when the budget exceeds the defined amount. The action automatically revokes Bedrock permissions for the targeted principal, providing a hard stop without manual intervention.
Practical Considerations
- Required permissions include the ability to manage cost allocation tags, create CUR exports, and configure budgets and budget actions.
- The solution works with any IAM user or role that accesses Bedrock; no additional SDK changes are needed.
- Optional components such as Athena and detailed CUR exports add query flexibility but are not mandatory for basic enforcement.
- Billing console access is separate from standard IAM permissions; verify that the deploying identity has the necessary billing rights.
Related CloudNinjas coverage: AWS.
What This Means For Practitioners
Adopting the native attribution‑report‑enforce pattern gives AI engineers, platform teams, and security owners a low‑maintenance way to monitor and cap Bedrock spend per principal. The primary operational impact is the one‑time setup of tags, CUR export, and budget actions; after that, cost visibility and enforcement are automatic. Teams should evaluate existing role structures to decide whether session tags or static role tags best represent individual users, and they should test the budget action in a non‑production account to confirm the deny policy behaves as expected before rolling out organization‑wide.

