
Attribute Amazon Bedrock Cost to IAM Identity Center Users
AWS IAM Identity Center roles cannot be tagged, and permission set tags do not propagate. Here is how to attribute Amazon Bedrock cost per SSO user anyway, using ABAC session tags.
With Amazon Bedrock , you can allow LLM access for your applications, your team's agentic coding tools, or your AI agents. Now, how would you know how much each team, cost center, project, environment, or user contributes to the Bedrock LLM inference cost? In general, you can use tagging (with AWS cost allocation tags ) and group the Bedrock cost at AWS Cost Explorer by the tags. See this documentation for more details.
In Part 1 we attributed Bedrock cost with two kinds of tags: IAM principal tags on the calling IAM User or IAM Role (who called?), and resource tags on application inference profiles (what did they call?). With principals from AWS IAM Identity Center , we use a different approach that is covered in this Part 2 of this blog post series.
The problem
IAM Identity Center provisions one IAM role per permission set per account, and AWS protects it. Trying to tag it like below will err out.
aws iam tag-role --role-name AWSReservedSSO_bedrock-users_330b14a695273844 \ --tags Key=costCenter,Value=CC-5005
# => An error occurred (UnmodifiableEntity): Cannot perform the operation on the protected role - this role is only modifiable by AWSSo you can tag the permission sets instead. However, the tag never reaches the role that actually calls Bedrock. This is documented behaviour, not a bug. From Tagging IAM Identity Center resources :
You can apply tags to permission sets only. You cannot apply tags to the corresponding roles that IAM Identity Center creates in AWS accounts.
Permission sets tags control which administrators can manage which permission sets. They were never an attribution mechanism.
The fix: tag the session, not the role
While you cannot put a static tag on the permission set's IAM Role, you can tag the session each time a user signs in. That is what attributes for access control (ABAC) does: pick a user attribute, give it a tag key, and Identity Center passes it as a session tag .
Where the tag gets attached, and why the code looks different
Session tags are always bound at role assumption time , by an AWS STS call. If you federate manually, or front Bedrock with an AI gateway, you make that call yourself and pass the tags inline:
# YOUR CODE, per usersts.assume_role( RoleArn = "arn:aws:iam::...:role/BedrockGatewayRole", RoleSessionName= "alice", # <-- you set this Tags = [{"Key":"costCenter","Value":"CC-5005"}] # <-- you set these)The code above yields temporary credentials that are used with subsequent API calls like
bedrock:InvokeModel . The tag should then appear in Cost Explorer as iamPrincipal/costCenter = CC-5005 .With Identity Center you never write that call. Signing in is the role assumption: Identity Center builds a SAML assertion and calls
sts:AssumeRoleWithSAML on the user's behalf. Since you do not control that call, you cannot pass tags into it. Instead you pre-declare them in the A BAC configuration , and Identity Center supplies them on every assumption for you.The flow can be illustrated in the following steps:
- Configure once:
- Configure attribute to that IAM Identity Center User, for example,
Cost center=CC-5005
- Configure ABAC mapping, for example
costCenter <- ${path:enterprise.costCenter}
- At runtime:
- User logs in with IAM Identity Center
- IAM Identity Center calls sts:AssumeRoleWithSAML while associating the tags as defined in ABAC configuration
- Call Bedrock with that signed in user
Note: You can watch this happen. In CloudTrail, theAssumeRoleWithSAMLevent from an Identity Center sign-in carriesroleSessionNameandprincipalTagsin itsrequestParameters, exactly where a manualAssumeRolecall would put them.
Three steps
Now let's see how one can configure these steps in more details. Refer to the following 3 steps.
1. Set the attributes on each user. If you use the IAM Identity Center native user directory, then set these attributes in IAM Identity Center. Navigate to AWS UI console: IAM Identity Center → Users → user → Edit user → Job-related information. Fill in the attributes, for example: Organization, Department, and Cost center. The attribute key names do not have to match your tag key name, since you can map them later in step 2.
From the CLI, these live in an extension, addressed with a dot:
aws identitystore update-user --identity-store-id d-xxxxxxxxxx --user-id <user-id> \ --operations '[{"AttributePath":"aws:identitystore:enterprise.costCenter","AttributeValue":"CC-5005"}]'Tip:describe-userwill not show these back unless you pass--extensions "aws:identitystore:enterprise".
IMPORTANT: If you use IAM Identity Center with external identity provider, you can set these attributes at the identity provider's attributes configuration. Please see this documentation .
The screenshot below shows this attributes editing in IAM Identity Center with AWS console.

2. Map each attribute to a tag key. This is the pre-declaration described above, and the only place the association between the attribute and the tags is defined.
Key becomes the cost allocation tag key, and Source is the user field it reads. They need not share a name.With AWS CLI, this is shown by the code snippet below. The call is asynchronous, so confirm
Status reaches ENABLED with describe-instance-access-control-attribute-configuration .aws sso-admin create-instance-access-control-attribute-configuration \ --instance-arn <instance> \ --instance-access-control-attribute-configuration '{"AccessControlAttributes":[ {"Key":"costCenter","Value":{"Source":["${path:enterprise.costCenter}"]}}, {"Key":"team", "Value":{"Source":["${path:enterprise.department}"]}}]}'With AWS console, you can do this through the UI as well by navigating to IAM Identity Center → Settings → Attributes for access control. This is shown in the following screenshot.

Casing matters, since
costCenter and costcenter are two different cost allocation tags. 3. Activate the tags. In the management account, open Cost allocation tags , filter Type = IAM principal, and activate your keys. Note that tags appear here only after a tagged principal has made at least one Bedrock request, and activation is not retroactive.
Verify before waiting on the bill
Billing data takes up to 24 hours to appear, twice over. Do not spend two days discovering a typo. Sign in again with the tagged IAM Identity Center User, because tags bind at sign-in and an existing session will not have them. Then make one Bedrock call and check CloudTrail for
AssumeRoleWithSAML :aws cloudtrail lookup-events \ --lookup-attributes AttributeKey=EventName,AttributeValue=AssumeRoleWithSAML \ --query 'Events[0].CloudTrailEvent' --output text | jq '.requestParameters.principalTags'principalTags | Meaning |
|---|---|
null | ABAC is not enabled |
{"costCenter":"","team":""} | ABAC mapped correctly, user attributes empty |
{"costCenter":"CC-5005","team":"developer-tools"} | Working |
The result
In Cost Explorer, set Group by → Tag. The picker separates the two families:

In my experiment, I selected
costCenter under IAM principal, filter Service to Bedrock, and each SSO user's cost center lands on its own cost category as shown in the following 2 screenshots.

The last two rows are the points that demonstrates the cost being attributed to
costCenter tag being carried by the SSO session tag.And because principal tags and resource tags sit in independent columns, they still stack. For example, filter
environment = prod from Part 1's inference profiles and group by iamPrincipal/costCenter to see which cost centers drive production spend, SSO users included.Gotchas worth knowing
Role chaining silently drops the tags. If requests flow
Identity Center → AWSReservedSSO_* → sts:AssumeRole → another role → Bedrock , attribution stops at the second hop. Session tags do not survive role chaining unless marked transitive. If you front Bedrock with an LLM/AI gateway that re-assumes a role, check this first and pass session tags explicitly at AssumeRole instead.An external IdP gives you more freedom. Identity Center's directory supports a fixed list of roughly 23 attributes, so you cannot invent a custom field. With Okta, Entra ID or JumpCloud you can skip that entirely and send the tag in the SAML assertion as
https://aws.amazon.com/SAML/Attributes/AccessControl:<TagKey> ( details ). Any IdP attribute maps to any tag key. Note it is AccessControl: , not PrincipalTag: , which is for direct IAM SAML federation and is ignored here.Mantle endpoint. IAM principal attribution covers both
bedrock-runtime and bedrock-mantle (the latter since August 2026) , so the approach in this post works either way. Application inference profiles do not apply to Mantle, so for the resource-tag axis use Projects and Workspaces there instead.Summary
Identity Center roles cannot be tagged, and permission set tags do not propagate. You need neither for the Bedrock cost attribution. Put the attributes on the IAM Identity Center User, map them with ABAC, and Identity Center passes them as session tags that Bedrock records exactly like static principal tags.
Two things to carry away. Verify at sign-in, not in the bill:
principalTags with empty values tells you far more than an empty chart 48 hours later. And role chaining drops attribution silently, so if anything re-assumes a role between sign-in and Bedrock, the tags are gone and nothing warns you.Together with Part 1 , that covers every caller: IAM users and roles tagged directly, workloads by resource tags on inference profiles, and workforce users through ABAC session tags.
Found this useful? A like helps it reach other builders, and I'd love to hear how you're attributing Bedrock cost in the comments, especially if you're doing it through an LLM gateway.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article