
Claude Code on AWS: Centralized Billing and Individual Team Logins
Set up Claude Code with Amazon Bedrock, individual AWS SSO logins, centralized billing, and restricted permissions. Includes Windows PowerShell commands.
Technical Lead at Coforge | AWS Community Builder | 11X AWS Certified
Sharing an API key is easy. Managing a team with shared credentials is not.
If you want developers to use Claude Code while keeping billing and access under your AWS account, a better approach is:
- Amazon Bedrock for access to Claude models.
- AWS IAM Identity Center for individual usernames, passwords, and MFA.
- Permission sets to restrict which models users can invoke.
- AWS Billing and Budgets to monitor spending centrally.
In this tutorial, we’ll configure the AWS side, connect Claude Code from a Windows PC, and add the controls needed for a small team.
Each developer will authenticate with their own identity. Nobody needs your root credentials, a shared password, or a permanent AWS access key.
This setup centralizes model-inference charges in AWS. It does not consume a developer’s Claude.ai subscription. It also does not automatically create a hard spending limit—budget alerts and spending enforcement are different things.
What we’re building
Developer's Windows PC │ ├── Claude Code └── AWS CLI with an SSO profile │ ▼ IAM Identity Center Individual login + MFA │ ▼ Restricted AWS role │ ▼ Amazon Bedrock Approved Claude models │ ▼ Centralized AWS billingWe’ll separate the walkthrough into administrator setup and developer setup.
Prerequisites
You’ll need:
- An AWS account with administrative access.
- An email address for each developer.
- A Windows PC with PowerShell.
- Permission to install AWS CLI and Claude Code.
- A small testing budget: successful model requests incur charges.
The examples use these values:
Setting | Example |
|---|---|
Workload account ID | 111122223333 |
Identity Center region | us-east-1 |
Bedrock source region | us-east-1 |
Identity Center group | ClaudeCodeUsers |
Permission set | ClaudeCodeBedrock |
Local AWS profile | claude-bedrock |
Primary model profile | us.anthropic.claude-sonnet-4-6 |
Background model profile | us.anthropic.claude-haiku-4-5-20251001-v1:0 |
Replace the account ID and portal URL with your own values.
The model IDs are explicit examples, not an instruction to always choose the newest model. Verify their availability in your account before rollout.
Region warning: Aus.inference profile can route requests across supported US regions. Choosingus-east-1as the source region does not guarantee processing exclusively in that region. For other geographic requirements, select an appropriate profile and update the policies accordingly.
1. Choose the AWS account that will run Bedrock
Who does this: administrator
You can start with your existing account. For an ongoing team deployment, a dedicated workload account is cleaner:
AWS Organizations management account │ └── Claude Code workload account └── Amazon Bedrock usageThis separates billing administration from developer activity and makes the team’s costs easier to identify.
If you currently have one standalone account:
- Secure the root user with MFA.
- Enable AWS Organizations with all features.
- Use an administrator identity for routine setup.
- Preferably create a member account dedicated to Claude Code.
Organizations provide consolidated billing, so the member account’s charges are still paid centrally.
You can use the existing management account for a pilot, but AWS recommends keeping workloads in member accounts. Another important distinction: service control policies do not restrict the management account.
2. Enable IAM Identity Center and create individual users
Who does this: administrator
Open IAM Identity Center in the organization’s management account.
- Select the region where you want Identity Center to reside.
- Enable an organization instance.
- Choose the Identity Center directory as the identity source.
- Record the AWS access portal URL.
The URL will look similar to:
https://YOUR-PORTAL.awsapps.com/startUse an organization instance, not an account instance. The organization instance provides the AWS account assignments and permission sets needed for this workflow.
Create the group
Under Groups → Create group, create:
ClaudeCodeUsers

Create each user
Under Users → Add user, enter the user’s details:
Field | Example |
|---|---|
Username | alice@example.com |
Email address | alice@example.com |
First name | Alice |
Last name | Example |
Set the username equal to the email address if you want email-style sign-in. These are separate fields.
Choose the option to email password-setup instructions, then add the user to
ClaudeCodeUsers .Repeat for the other developers.
These are Identity Center users, not IAM users with permanent access keys.
Require MFA
Under Settings → Authentication → Multi-factor authentication:
- Require MFA.
- Require users without an MFA device to register one at sign-in.
- Choose an appropriate sign-in prompt policy.
- Allow approved authenticator apps or security keys.
Users create their own passwords. You manage their access without needing to know those passwords.
At this point, users exist but do not yet have access to an AWS account. We’ll assign that shortly.

3. Prepare access to the Claude models
Who does this: administrator
Switch to the account where Bedrock usage will run.
- Open Amazon Bedrock.
- Select your source region—for this example,
us-east-1.
- Open Model catalog.
- Find Claude Sonnet 4.6 and Claude Haiku 4.5.
- Complete any required Anthropic use-case form.
- Review the applicable terms and complete model activation.
- Test each model with a small playground request.
Model-access requirements can differ by model and region. Follow the current catalog prompts rather than assuming every model uses the same onboarding process.
AWS can initiate the required Marketplace subscription on first invocation. Have an authorized administrator complete this setup.
Ordinary developers do not need Marketplace subscription-management permissions once the models are enabled.


4. Create a restricted permission set
Who does this: administrator
Avoid giving developers
AdministratorAccess or AmazonBedrockFullAccess .In IAM Identity Center:
- Open Permission sets.
- Choose Create permission set.
- Select Custom permission set.
- Name it
ClaudeCodeBedrock.
- Set the session duration to 1 hour for the initial deployment.
- Add the following inline policy.
Note:
- Replace every occurrence of
111122223333with your workload account ID
- ARN can be a little different, so it's good to double-check
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DiscoverInferenceProfiles", "Effect": "Allow", "Action": "bedrock:ListInferenceProfiles", "Resource": "*" }, { "Sid": "ReadApprovedProfiles", "Effect": "Allow", "Action": "bedrock:GetInferenceProfile", "Resource": [ "arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.anthropic.claude-sonnet-4-6", "arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.anthropic.claude-haiku-4-5-20251001-v1:0" ] }, { "Sid": "InvokeApprovedProfiles", "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.anthropic.claude-sonnet-4-6", "arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.anthropic.claude-haiku-4-5-20251001-v1:0" ] }, { "Sid": "InvokeModelsOnlyThroughApprovedProfiles", "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:us-*::foundation-model/anthropic.claude-sonnet-4-6", "arn:aws:bedrock:us-*::foundation-model/anthropic.claude-haiku-4-5-20251001-v1:0" ], "Condition": { "StringEquals": { "bedrock:InferenceProfileArn": [ "arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.anthropic.claude-sonnet-4-6", "arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.anthropic.claude-haiku-4-5-20251001-v1:0" ] } } }, { "Sid": "CountTokensForApprovedModels", "Effect": "Allow", "Action": "bedrock:CountTokens", "Resource": [ "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-sonnet-4-6", "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-haiku-4-5-20251001-v1:0" ] } ]}Why authorize both profiles and models?
Cross-region inference requires access to:
- The selected inference profile.
- Its underlying foundation models in the relevant regions.
The
bedrock:InferenceProfileArn condition limits the foundation-model permission to requests using the approved profiles.The
us-* pattern accommodates US destination regions. For tighter resource scoping, replace it with the exact model ARNs returned by get-inference-profile later in this guide.The final statement enables token-counting functionality; it does not grant additional model-generation access.
This policy does not permit developers to manage users, change billing settings, or create infrastructure.
These restrictions assume the users do not receive broader access through another role or policy.
Assign the group to the workload account
Still in IAM Identity Center:
- Open AWS accounts.
- Select the workload account.
- Choose Assign users or groups.
- Select
ClaudeCodeUsers.
- Select
ClaudeCodeBedrock.
- Submit and wait for provisioning to finish.
Checkpoint: A group member should now see the workload account and assigned role in the AWS access portal.
5. Add a user tag for cost attribution
Who does this: administrator
All requests made in the workload account are centrally billed. However, users assigned the same permission set generally share the same IAM role.
That means role-level reporting alone does not separate Alice’s costs from Bob’s.
Bedrock supports IAM-principal cost attribution, including session tags that distinguish people using a shared role.
In IAM Identity Center:
- Open Settings → Attributes for access control.
- Enable the feature.
- Choose Manage attributes.
- Add this mapping:
Key | Value |
|---|---|
User | ${path:userName} |
- Save and wait for configuration to complete.
Because the username is the email address, the session tag will identify the user:
User = alice@example.comConfigure this through Identity Center rather than manually editing its protected
AWSReservedSSO_* roles.If users authenticated before the change, have them obtain fresh credentials and restart Claude Code. Existing sessions do not acquire new tags retroactively.
We’ll activate the tag in Billing after the first requests are made.
References:
6. Install the tools on Windows
Who does this: each developer
Use a separate Windows account for each person. Do not share a workstation login containing another person’s cached AWS credentials.
Install AWS CLI v2
Run the official Windows installer:
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msiFollow the prompts. This all-users installation normally requires administrator approval.
Close and reopen PowerShell, then check:
aws --versionThe output should begin with:
aws-cli/2.Install Git for Windows
Git for Windows is recommended for Claude Code’s Bash-based tools.
If Windows Package Manager is available:
winget install --id Git.Git --exact --source wingetInstall Claude Code
In a normal PowerShell window:
irm https://claude.ai/install.ps1 | iexThis downloads and executes the official installer. Follow your organization’s software-installation policy.
Reopen PowerShell and verify:
claude --versionclaude doctorIf Git Bash is installed but not detected, set its actual location:
$env:CLAUDE_CODE_GIT_BASH_PATH = "C:\Program Files\Git\bin\bash.exe"7. Configure the developer’s AWS SSO profile
Who does this: each developer
The administrator should provide:
- AWS access portal URL.
- Identity Center region.
- Workload account ID.
- Permission-set name.
- Bedrock region.
Run:
aws configure sso --profile claude-bedrockUse these values when prompted:
Prompt | Value |
|---|---|
SSO session name | company |
SSO start URL | Your actual portal URL |
SSO region | Your Identity Center region |
SSO registration scopes | sso:account:access |
AWS account | The workload account |
Role | ClaudeCodeBedrock |
Default client region | us-east-1 |
Default output format | json |
Complete browser authentication with your own username, password, and MFA.
The Identity Center region and Bedrock region do not have to match.
Then run:
aws sso login --profile claude-bedrockRemove conflicting credentials from the test shell
If this PC previously used static AWS credentials or a Bedrock API key, clear them from the current PowerShell session:
Remove-Item Env:AWS_ACCESS_KEY_ID -ErrorAction SilentlyContinueRemove-Item Env:AWS_SECRET_ACCESS_KEY -ErrorAction SilentlyContinueRemove-Item Env:AWS_SESSION_TOKEN -ErrorAction SilentlyContinueRemove-Item Env:AWS_BEARER_TOKEN_BEDROCK -ErrorAction SilentlyContinueThese commands do not delete credential files or persistent system settings.
In particular,
AWS_BEARER_TOKEN_BEDROCK bypasses Claude Code’s normal AWS credential chain. Leave it unset for this SSO-based setup.Verify the AWS identity
aws sts get-caller-identity --profile claude-bedrockCheck that:
-
Accountmatches the workload account.
-
Arncontains an assumed role associated withClaudeCodeBedrock.
If the account or role is wrong, stop here and correct the profile.
8. Connect Claude Code to Bedrock
Who does this: each developer
First, check access to the two inference profiles:
aws bedrock get-inference-profile --profile claude-bedrock --region us-east-1 --inference-profile-identifier us.anthropic.claude-sonnet-4-6aws bedrock get-inference-profile --profile claude-bedrock --region us-east-1 --inference-profile-identifier us.anthropic.claude-haiku-4-5-20251001-v1:0Inspect the returned profile ARNs and model ARNs.
Profile discovery is useful, but it does not prove that inference is authorized. We’ll test that next.
Configure the current PowerShell session
$env:CLAUDE_CODE_USE_BEDROCK = "1"$env:AWS_PROFILE = "claude-bedrock"$env:AWS_REGION = "us-east-1"
$env:ANTHROPIC_MODEL = "us.anthropic.claude-sonnet-4-6"$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "us.anthropic.claude-sonnet-4-6"$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "us.anthropic.claude-haiku-4-5-20251001-v1:0"These settings select:
- Bedrock as the provider.
- The named SSO profile.
- The source region.
- Sonnet for the primary model.
- Haiku for background work.
Pinning models makes the deployment more predictable than relying on changing defaults.
Run a small test
Create an empty directory:
New-Item -ItemType Directory -Path "$HOME\claude-bedrock-test" -Force | Out-NullSet-Location "$HOME\claude-bedrock-test"Run:
claude -p "Reply with exactly: Bedrock connection successful"A successful response confirms that Claude Code can invoke the model through Bedrock.
This is a real, billable request. Claude Code may also make startup or background requests.
Now start an interactive session:
claudeInside Claude Code, run:
/statusConfirm that the provider is Amazon Bedrock, with the expected region and model.
If it shows another provider, inspect existing environment variables and Claude Code settings before continuing.
9. Save the Claude Code configuration
Who does this: each developer
PowerShell
$env: assignments apply only to the current process and its children.To retain the configuration, edit:
%USERPROFILE%\.claude\settings.jsonOpen it with:
New-Item -ItemType Directory -Path "$HOME\.claude" -Force | Out-Nullnotepad "$HOME\.claude\settings.json"For a new file, use:
{ "env": { "CLAUDE_CODE_USE_BEDROCK": "1", "AWS_PROFILE": "claude-bedrock", "AWS_REGION": "us-east-1", "ANTHROPIC_MODEL": "us.anthropic.claude-sonnet-4-6", "ANTHROPIC_DEFAULT_SONNET_MODEL": "us.anthropic.claude-sonnet-4-6", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "us.anthropic.claude-haiku-4-5-20251001-v1:0" }}If the file already exists, merge these values instead of replacing the existing configuration.
Never store passwords, access keys, or session tokens in this file.
The daily workflow
When authentication is needed:
aws sso login --profile claude-bedrockThen open a project directory and run:
claudeThat’s the developer experience: individual browser authentication followed by normal Claude Code usage.
10. Activate cost reporting and configure budgets
Who does this: administrator
Activate the user tag
After a user has made a Bedrock request with a tagged session:
- Sign in to the management/payer account.
- Open Billing and Cost Management.
- Open Cost allocation tags.
- Filter by type IAM principal.
- Find the
Usertag.
- Activate it.
Generate additional test usage after activation.
In Cost Explorer:
- Filter to the workload account.
- Inspect the Bedrock/model charges.
- Group by the activated user tag, exposed with the
iamPrincipal/prefix, such asiamPrincipal/User.
You should eventually be able to compare usage attributed to different users.
Important limitations:
- Billing data is not real-time.
- The finest documented granularity is per usage type per day.
- Tag activation does not retroactively tag earlier usage.
- Tags and cost data can take up to 24 hours at the documented processing stages.
For detailed exports, create a CUR 2.0 data export with the option to include the caller identity ARN.
Do not treat a successful
get-caller-identity response as proof that tags are flowing: that command does not show session tags. Validate attribution with a two-user billing test.Configure a monthly budget
In AWS Budgets:
- Create a monthly cost budget.
- Filter it to the workload account.
- Set an amount appropriate for the pilot.
- Add actual-spend and forecast notifications.
For example:
Threshold | Action |
|---|---|
50% actual spend | Notify the administrator |
80% actual spend | Notify the administrator and team owner |
100% actual spend | Urgent review |
100% forecast spend | Warn before month-end |
A $100 budget does not mean AWS stops serving requests at exactly $100.
Billing and budget evaluation are delayed. Budget actions can apply restrictive policies, but they are not instantaneous prepaid-balance enforcement.
If you require strict per-user allowances, you need an additional request-time enforcement layer, typically a controlled gateway with individual authentication and usage accounting. Users must not retain direct Bedrock permissions that let them bypass it.
11. Manage access and emergency shutdowns
Who does this: administrator
Adding a developer
- Create the Identity Center user.
- Add them to
ClaudeCodeUsers.
- Require password setup and MFA.
- Share the portal URL and PC instructions.
- Verify their usage appears in reporting.
Removing a developer
- Remove their group membership and direct account assignments.
- Delete active Identity Center portal sessions.
- Disable user access.
- Check for other roles or groups that still grant access.
Already-issued AWS role credentials can remain usable until they expire.
Disabling a user or running
aws sso logout is not an instant revocation of every active AWS credential.Emergency stop for the whole team
To block subsequent inference requests through this permission set, append this statement to its inline policy:
{ "Sid": "EmergencyStopInference", "Effect": "Deny", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": "*"}Save the change and ensure the updated permission set is successfully provisioned to the workload account.
After policy propagation, the explicit deny applies to subsequent calls from existing and new sessions of that role.
This is not an account-wide or instantaneous spending stop:
- Other roles are unaffected.
- Already-incurred charges remain.
- An in-flight request is not guaranteed to be cancelled.
What administrator control does—and does not—cover
The important boundary is the AWS account, not the developer’s entire computer.
Requirement | Control |
|---|---|
Individual sign-ins | Identity Center users and MFA |
Approved models only | Restricted IAM permissions |
Centralized billing | Shared workload account and consolidated billing |
Per-user cost visibility | Session tags and billing attribution |
Spending warnings | AWS Budgets |
Company-wide client configuration | Managed Claude Code settings and device management |
Strict per-user spending allowances | Additional request-time enforcement architecture |
A user-editable
settings.json file is configuration, not a security boundary.For company-managed Windows devices, Claude Code supports managed settings at:
C:\Program Files\ClaudeCode\managed-settings.jsonDistribute and protect those settings through device management. Keep the AWS permission restrictions as well: someone with valid AWS credentials can use another API client.
Also, cost attribution does not automatically provide a searchable record of every prompt. If you enable model-invocation logging, consider the sensitivity of source code and other content, restrict log access, set retention, and inform users.
Common problems
Problem | What to check |
|---|---|
aws or claude is not recognized | Reopen PowerShell and check installation/PATH |
No account appears during SSO setup | Verify group-to-account assignment |
SSO credentials expired | Run aws sso login --profile claude-bedrock |
Wrong AWS account | Check the selected profile and conflicting credentials |
AccessDeniedException | Check model onboarding, profile/model permissions, and organization policies |
On-demand throughput error | Use the supported inference-profile ID |
Background tasks fail | Check the Haiku model pin, access, and permissions |
Region-related failure | Check profile availability and required destination regions |
Another provider appears in /status | Inspect existing environment and Claude Code settings |
Billing tag is missing | Use fresh tagged credentials, generate usage, activate the tag, and allow processing time |
All costs appear under one role | Verify the per-user session-tag mapping |
Before rolling this out to everyone
Test the complete flow with two users:
- Each person signs in with their own password and MFA.
- Both receive the restricted permission set.
-
get-caller-identityshows the correct account and role.
- Claude Code successfully uses Bedrock.
-
/statusshows the intended provider, region, and model.
- A model outside the approved policy cannot be invoked.
- Billing attribution separates the two users.
- Budget notifications are configured.
- Offboarding and emergency-deny procedures have been tested.
Final thoughts
The key is to separate three responsibilities:
- Identity Center decides who can sign in.
- IAM decides what their AWS role can do.
- Billing tools show what that access costs.
Claude Code then becomes a client of your controlled AWS environment rather than another shared credential to manage.
Start with a small pilot, pin the models, verify the permissions, and test cost attribution before opening access to the whole team.
Note: I will try to create a separate blog for Linux or macOS, but the instructions are similar
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article