Implementing Multi-Environment Access for Claude Platform on AWS

Learn how to configure secure, multi-environment access to Claude Platform on AWS from a single subscription: cross-account SigV4 for AWS workloads, workspace-scoped API keys for developers, and OIDC federation for external environments, with workspace-level isolation in a dedicated AI Services account.

Oct 1, 2026 - 21:00
 1
Implementing Multi-Environment Access for Claude Platform on AWS

You need Claude Platform on AWS (CPonAWS) inference from three environments: production workloads on AWS, developer laptops for local iteration, and external services on other cloud providers or on-premises continuous integration and continuous delivery (CI/CD) pipelines. Each environment has different authentication requirements, but all should share a single subscription with workspace-level isolation between production and development traffic. For organizations with additional environments, create a workspace per team or workload and repeat the cross-account role pattern for each.

This post walks you through the complete setup. You will deploy a dedicated AI Services account within your organization and configure cross-account SigV4 for AWS workloads. You will also generate workspace-scoped API keys for developers and wire up OIDC federation for external environments. Every step includes a CLI command, console instruction, or code snippet. If you’re evaluating which account structure is right for your organization, or which authentication path fits your workloads, see the related Architecture Patterns and Authentication Paths posts. This post picks up where those decisions end: a complete, step-by-step implementation.

The architecture

The dedicated AI Services account pattern places the CPonAWS subscription in a dedicated AI Services linked account within your organization. This account owns the subscription, workspaces, API keys, and cross-account roles. Workload accounts don’t touch the subscription directly: they assume roles into the AI Services account to make inference calls. The result is a three-account structure: a payer (management) account for billing and governance, an AI Services account that hosts the CPonAWS subscription and workspaces, and one or more workload accounts that consume inference through cross-account roles, as shown in the following diagram.

Three-account structure: a payer account, an AI Services account that hosts the CPonAWS subscription, and workload accounts that connect through cross-account roles

Figure 1: Multi-account topology for Claude Platform on AWS with a dedicated AI Services account

The preceding diagram shows the high-level account topology. The following diagram shows the specific implementation we will build, including AWS Identity and Access Management (IAM) roles, access paths, and workspace mappings:

Three access paths into the AI Services account: cross-account SigV4 from an Amazon EKS pod, a workspace-scoped API key from a developer laptop, and OIDC federation from an external workload

Figure 2: The three access patterns implemented in this guide

We will configure three access patterns:

  • AWS workload accounts through cross-account SigV4: A pod hosted on Amazon Elastic Kubernetes Service (Amazon EKS) in a workload account assumes a role in the AI Services account. It then makes SigV4-signed inference calls. No API keys stored, no secrets to rotate.
  • Developer laptops through a workspace-scoped API key: A long-lived API key locked to a development workspace. Developers use it locally with the standard Anthropic SDK.
  • External workloads through OpenID Connect (OIDC) federation and short-term keys: A workload hosted outside AWS authenticates through OIDC, obtains temporary AWS credentials. It generates a short-lived token and makes inference calls with zero persistent credentials.

Prerequisites

Before starting, verify you have:

  • An organization in AWS Organizations with:
    • A payer (management) account.
    • An AWS linked account for AI Services subscriptions (will host the CPonAWS subscription).
    • An AWS linked account for hosting workload (for example, “Prod”).
  • AWS Command Line Interface (AWS CLI) v2 installed and configured with named profiles for both accounts.
  • Python 3.12+ with the following packages: anthropic[aws], boto3, token-generator-for-aws-external-anthropic.

Step-by-step guide

This walkthrough is divided into four parts. Each part configures one layer of the architecture: the CPonAWS subscription and workspace structure, cross-account SigV4 access for AWS workloads, workspace-scoped API keys for developers, and OIDC federation for external environments. Complete them in order. Each part builds on the resources created in the previous one.

Placeholder reference

Throughout this guide, replace these placeholders with your actual values:

Placeholder Description Example
YOUR_ORG_ID AWS Organizations ID o-abc123def4
YOUR_REGION AWS Region where the workspace was created us-east-1
AI_SERVICES_ACCOUNT_ID AWS account ID of the AI Services account 123456789012
WORKLOAD_ACCOUNT_ID AWS account ID of the Workload account 987654321098
WORKSPACE_PROD_ID Anthropic production workspace ARN wrkspc_01abc...
WORKSPACE_DEV_ID Anthropic development workspace ARN wrkspc_02def...
YOUR_OIDC_ISSUER OIDC identity provider URL accounts.google.com
YOUR_WORKLOAD_IDENTITY_FILTER Subject claim filter for OIDC trust system:serviceaccount:ns:sa

Part 1: Set up the AI Services account

Follow the Introducing Claude Platform on AWS guide to subscribe your AI Services account to CPonAWS. After you’re subscribed, create two workspaces to isolate production and development traffic:

  1. Access the AWS Management Console on the AI Services account, and navigate to Claude Platform on AWS.
  2. Navigate to Access, and sign in as Admin.
  3. In the Claude Console, choose the drop-down menu in the top left corner and choose Create Workspace. Enter the name production, and choose Create.
Claude Console dashboard with the workspace menu open in the top left corner and the Create Workspace option

Figure 3: Claude Console dashboard showing how to create a workspace

  1. Note the workspace ARN (for example, wrkspc_PROD).
  2. Repeat to create a second workspace named development (for example, wrkspc_DEV).

Tip: Record both workspace ARNs now. You will reference them in IAM policies and code throughout this guide. Workspaces are created in a specific AWS Region, and your API calls must target the matching Regional endpoint (for example, aws-external-anthropic.us-east-1.api.aws). Note that the workspace Region determines the API endpoint, not where inference runs. Inference geography is controlled separately through the workspace’s Security settings in the Claude Console. Current options are “US” and “Global routing”. For short-term keys, this is enforced at both generation and use: the token only works against the same Regional endpoint where it was generated. Long-lived API keys are not Region-locked. For supported Regions and available models, see Supported Regions and models in the Claude Platform on AWS User Guide.

Part 2: Cross-account SigV4 for AWS workloads

This section configures an EKS pod (or another workload) in the Workload account to make inference calls through SigV4 signing. The workload assumes a role in the AI Services account that grants access only to the production workspace.

2.1 Create the cross-account role (AI Services account)

First, create the trust policy file in the AI Services account. This allows a specific role in the Workload account to assume the cross-account role.

  1. Access the AWS Management Console in the AI Services account, and open AWS CloudShell.
  2. Save this file as trust-policy.json.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::WORKLOAD_ACCOUNT_ID:role/EKS-Pod-Role"
            },
            "Action": "sts:AssumeRole",
            "Condition": {
                "StringEquals": {
                    "aws:PrincipalOrgID": "YOUR_ORG_ID"
                }
            }
        }
    ]
}
  1. Create the role by running the following command.
# From the AI Services account profile
aws iam create-role \
    --role-name CrossAccount-ClaudePlatform-Prod \
    --assume-role-policy-document file://trust-policy.json \
    --description "Allows workload account to invoke CPonAWS production workspace" \
    --profile ai-services

2.2 Attach the permission policy (AI Services account)

  1. Save this file as permission-policy.json.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CPonAWSInference",
            "Effect": "Allow",
            "Action": [
                "aws-external-anthropic:CreateInference",
                "aws-external-anthropic:CountTokens",
                "aws-external-anthropic:GetModel",
                "aws-external-anthropic:ListModels"
            ],
            "Resource": "arn:aws:aws-external-anthropic:YOUR_REGION:AI_SERVICES_ACCOUNT_ID:workspace/WORKSPACE_PROD_ID"
        },
        {
            "Sid": "CPonAWSResourceless",
            "Effect": "Allow",
            "Action": "aws-external-anthropic:GetAccountStatus",
            "Resource": "*"
        },
        {
            "Sid": "STSWebIdentity",
            "Effect": "Allow",
            "Action": ["sts:GetWebIdentityToken", "sts:TagGetWebIdentityToken"],
            "Resource": "*"
        }
    ]
}
  1. Attach the policy to the role:
aws iam put-role-policy \
    --role-name CrossAccount-ClaudePlatform-Prod \
    --policy-name CPonAWS-Inference-Prod \
    --policy-document file://permission-policy.json \
    --profile ai-services

Note: CreateInference is scoped to the WORKSPACE_PROD_ID workspace ARN. This role cannot access the development workspace or additional workspace in the account.

2.3 Grant AssumeRole (Workload account)

The EKS pod role in the Workload account needs permission to assume the cross-account role. First, create the policy.

  1. Access the AWS Management Console in the Workload account, and open AWS CloudShell.
  2. Save this file as allow-assume-cponaws.json.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "sts:AssumeRole",
            "Resource": "arn:aws:iam::AI_SERVICES_ACCOUNT_ID:role/CrossAccount-ClaudePlatform-Prod"
        }
    ]
}
  1. Create and attach the policy.
aws iam create-policy \
    --policy-name AllowAssumeCPonAWSRole \
    --policy-document file://allow-assume-cponaws.json \
    --profile workload-prod

aws iam attach-role-policy \
    --role-name EKS-Pod-Role \
    --policy-arn arn:aws:iam::WORKLOAD_ACCOUNT_ID:policy/AllowAssumeCPonAWSRole \
    --profile workload-prod

2.4 Test (from the Workload account)

  1. Run the following Python script from a machine (or pod) with the EKS-Pod-Role credentials.
import boto3, os
from anthropic import AnthropicAWS

# Assume the cross-account role in the AI Services account
sts = boto3.client("sts")
assumed = sts.assume_role(
    RoleArn="arn:aws:iam::AI_SERVICES_ACCOUNT_ID:role/CrossAccount-ClaudePlatform-Prod",
    RoleSessionName="prod-workload"
)
creds = assumed["Credentials"]
os.environ["AWS_ACCESS_KEY_ID"] = creds["AccessKeyId"]
os.environ["AWS_SECRET_ACCESS_KEY"] = creds["SecretAccessKey"]
os.environ["AWS_SESSION_TOKEN"] = creds["SessionToken"]

# Make an inference call
client = AnthropicAWS(aws_region="YOUR_REGION", workspace_id="WORKSPACE_PROD_ID")
resp = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=128,
    messages=[{"role": "user", "content": "Hello from the workload account!"}]
)
print(resp.content[0].text)

Part 3: Workspace-scoped API key for developer access

Developers can use API keys to call Claude from their laptops without configuring cross-account role chains. In the following section, you will generate a key, scope it to the development workspace, and verify isolation.

3.1 Generate an API key (AI Services account)

  1. Sign in to the AI Services account on the AWS Management Console.
  2. Navigate to Claude Platform on AWS, then API keys.
  3. Choose Generate long-term key, select an API key expiration, and choose Generate.
  4. Copy the key value immediately (store it securely: you won’t see it again).
Claude Console API Keys page showing the long-term key generation dialog with expiration options

Figure 4: Generating a long-term API key from the Claude Console (API Keys page) with configurable expiration

3.2 Scope the key to the development workspace (AI Services account)

By default, the generated key’s backing IAM user (AeaApiKey-*) has the AnthropicLimitedAccess managed policy attached. This policy grants access to every workspace. To enforce workspace isolation:

  1. On the AWS Management Console (AI Services account), navigate to IAM, then Users.
  2. Search for users starting with AeaApiKey-.
  3. Find the most recently created user (the creation timestamp should match when you generated the key).
  4. Select the user, and then choose the Permissions tab.
  5. Select the AnthropicLimitedAccess policy, and choose Remove to detach the managed policy.
  6. Choose Add permissions, then Create inline policy.
  7. Switch to the JSON tab and paste the following.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "InferenceDevWorkspaceOnly",
            "Effect": "Allow",
            "Action": [
                "aws-external-anthropic:CreateInference",
                "aws-external-anthropic:CountTokens"
            ],
            "Resource": "arn:aws:aws-external-anthropic:YOUR_REGION:AI_SERVICES_ACCOUNT_ID:workspace/wrkspc_DEV"
        },
        {
            "Sid": "BearerTokenAndStatus",
            "Effect": "Allow",
            "Action": [
                "aws-external-anthropic:CallWithBearerToken",
                "aws-external-anthropic:GetAccountStatus"
            ],
            "Resource": "*"
        },
        {
            "Sid": "STSWebIdentity",
            "Effect": "Allow",
            "Action": ["sts:GetWebIdentityToken", "sts:TagGetWebIdentityToken"],
            "Resource": "*"
        }
    ]
}
  1. Name the policy CPonAWS-DevWorkspace-Only and choose Create policy.

3.3 Distribute the key to the development team (Workload account or developer environment)

The admin distributes the scoped API key to the development team. Store it in the team’s preferred secret management solution. For AWS based teams, store it in AWS Secrets Manager within the workload or developer AWS account:

aws secretsmanager create-secret \
    --name cponaws/dev-api-key \
    --secret-string "YOUR_API_KEY_VALUE" \
    --region YOUR_REGION \
    --profile workload-prod

Note: The API key is self-authenticating. It works regardless of which AWS account (or non-AWS environment) it’s called from. Store it wherever your developers can retrieve it securely.

3.4 Test (from developer laptop)

  1. Run the following code from your laptop configured with the profile of the same account where the secret was created in the previous step.
import boto3
from anthropic import Anthropic

# Retrieve the API key from Secrets Manager
secrets = boto3.client('secretsmanager', region_name='YOUR_REGION')
api_key = secrets.get_secret_value(SecretId='cponaws/dev-api-key')['SecretString']

# Create the client pointing to the CPonAWS endpoint
client = Anthropic(
    api_key=api_key,
    base_url='https://aws-external-anthropic.YOUR_REGION.api.aws'
)

# Make an inference call to the development workspace
resp = client.messages.create(
    model='claude-sonnet-4-6',
    max_tokens=128,
    messages=[{"role": "user", "content": "Hello from my laptop!"}],
    extra_headers={'anthropic-workspace-id': 'WORKSPACE_DEV_ID'}
)
print(resp.content[0].text)

Expected output: A response from Claude confirming the development workspace is accessible.

3.5 Verify workspace isolation (from developer laptop)

  1. Confirm the development key cannot access the production workspace.
# Attempt to call the production workspace with the dev key
try:
    resp = client.messages.create(
        model='claude-sonnet-4-6',
        max_tokens=32,
        messages=[{"role": "user", "content": "test"}],
        extra_headers={'anthropic-workspace-id': 'wrkspc_PROD'}
    )
    print("ERROR: Key accessed production workspace!")
except Exception as e:
    print(f"GOOD: Access denied as expected - {e}")

Expected output: GOOD: Access denied as expected followed by a permission error. If the key successfully accesses the production workspace, revisit step 3.2 and confirm the managed policy was detached.

Part 4: OIDC federation for external workloads

For workloads running on Google Cloud Platform (GCP), Kubernetes clusters outside AWS, or CI/CD pipelines (GitHub Actions, GitLab CI), OIDC federation authenticates them without storing AWS credentials. The flow: the external identity provider issues a token, and AWS Security Token Service (STS) exchanges it for temporary credentials. Those credentials then generate a short-lived CPonAWS bearer token.

4.1 Create an IAM OIDC identity provider (AI Services account)

Configure an IAM OIDC identity provider in your AI Services account for your external workload’s issuer. For example, for GCP workloads follow the Access AWS using a Google Cloud Platform native workload identity guide for the complete setup.

4.2 Create a role for external workloads (AI Services account)

  1. Access the AWS Management Console in the AI Services account, and open AWS CloudShell.
  2. Save as oidc-trust-policy.json.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::AI_SERVICES_ACCOUNT_ID:oidc-provider/YOUR_OIDC_ISSUER"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "YOUR_OIDC_ISSUER:aud": "sts.amazonaws.com"
                },
                "StringLike": {
                    "YOUR_OIDC_ISSUER:sub": "YOUR_WORKLOAD_IDENTITY_FILTER"
                }
            }
        }
    ]
}
  1. Create the role:
aws iam create-role \
    --role-name OIDC-ClaudePlatform-Prod \
    --assume-role-policy-document file://oidc-trust-policy.json \
    --description "Allows external OIDC workloads to invoke CPonAWS production workspace" \
    --profile ai-services
  1. Save the permission policy as oidc-permission-policy.json.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CPonAWSInference",
            "Effect": "Allow",
            "Action": [
                "aws-external-anthropic:CreateInference",
                "aws-external-anthropic:CountTokens",
                "aws-external-anthropic:GetModel",
                "aws-external-anthropic:ListModels"
            ],
            "Resource": "arn:aws:aws-external-anthropic:YOUR_REGION:AI_SERVICES_ACCOUNT_ID:workspace/WORKSPACE_PROD_ID"
        },
        {
            "Sid": "CPonAWSResourceless",
            "Effect": "Allow",
            "Action": [
                "aws-external-anthropic:CallWithBearerToken",
                "aws-external-anthropic:GetAccountStatus"
            ],
            "Resource": "*"
        },
        {
            "Sid": "STSWebIdentity",
            "Effect": "Allow",
            "Action": ["sts:GetWebIdentityToken", "sts:TagGetWebIdentityToken"],
            "Resource": "*"
        }
    ]
}
  1. Attach the policy:
aws iam put-role-policy \
    --role-name OIDC-ClaudePlatform-Prod \
    --policy-name CPonAWS-OIDC-Inference-Prod \
    --policy-document file://oidc-permission-policy.json \
    --profile ai-services

Important: CallWithBearerToken must be granted on Resource: "*". Scoping it to a workspace ARN causes all token generation calls to fail. CreateInference remains scoped to the workspace ARN for isolation: the generated token inherits the workspace restriction.

4.3 Generate and use a short-term token (from external environment)

  1. After the external workload has obtained AWS credentials through OIDC (see Access AWS using a Google Cloud Platform native workload identity for the full credential exchange flow):
from token_generator_for_aws_external_anthropic import TokenGenerator
from anthropic import Anthropic
from datetime import timedelta

# Step 1: Generate a short-term token (requires the OIDC-assumed role's AWS credentials)
generator = TokenGenerator(region='YOUR_REGION')
token = generator.get_token(expiry=timedelta(hours=1))

# Step 2: Use the token (no AWS credentials needed from this point forward)
client = Anthropic(
    api_key=token,
    base_url='https://aws-external-anthropic.YOUR_REGION.api.aws'
)
resp = client.messages.create(
    model='claude-sonnet-4-6',
    max_tokens=128,
    messages=[{"role": "user", "content": "Hello from GCP via OIDC!"}],
    extra_headers={'anthropic-workspace-id': 'wrkspc_PROD'}
)
print(resp.content[0].text)

Key point: The generated token expires after 1 hour (configurable, maximum 12 hours). After generation, the token is a standalone bearer credential: the external workload no longer needs AWS credentials to make inference calls. For services that run continuously (for example, a GCP Cloud Run container), implement token renewal by refreshing the token before expiry.

Part 5: Cleanup

To avoid ongoing charges if you are evaluating:

  1. Revoke API keys: On the AWS Management Console, navigate to Claude Platform on AWS, API keys. Delete any generated keys.
  2. Delete backing IAM users: Navigate to IAM > Users, search for AeaApiKey-*, and delete any users created by the key generation process.
  3. Delete IAM roles:
# Remove inline policies first, then delete the roles
aws iam delete-role-policy \
    --role-name CrossAccount-ClaudePlatform-Prod \
    --policy-name CPonAWS-Inference-Prod \
    --profile ai-services

aws iam delete-role \
    --role-name CrossAccount-ClaudePlatform-Prod \
    --profile ai-services

aws iam delete-role-policy \
    --role-name OIDC-ClaudePlatform-Prod \
    --policy-name CPonAWS-OIDC-Inference-Prod \
    --profile ai-services

aws iam delete-role \
    --role-name OIDC-ClaudePlatform-Prod \
    --profile ai-services
  1. Delete the OIDC provider:
aws iam delete-open-id-connect-provider \
    --open-id-connect-provider-arn arn:aws:iam::AI_SERVICES_ACCOUNT_ID:oidc-provider/YOUR_OIDC_ISSUER \
    --profile ai-services
  1. Delete secrets.
aws secretsmanager delete-secret \
    --secret-id cponaws/dev-api-key \
    --force-delete-without-recovery \
    --region YOUR_REGION \
    --profile ai-services
  1. Unsubscribe from CPonAWS: Navigate to AWS Marketplace, Your Subscriptions, and cancel the Claude Platform subscription.

What’s next

With cross-account SigV4, workspace-scoped API keys, and OIDC federation configured, your CPonAWS deployment supports AWS workloads, developer access, and external environments with workspace-level isolation. To harden for production:

  • Monitoring: Configure AWS CloudTrail data events for the aws-external-anthropic service to get per-call auditability with principal attribution.
  • Cost allocation: Tag each workspace (for example, team:payments, environment:prod) and activate those tags in the Billing Console under Cost Allocation Tags. Once active (allow 24–48 hours), you can filter AWS Cost Explorer by workspace to attribute Claude spend to specific projects, teams, or environments.

To get started with Claude Platform on AWS, visit the Claude Platform on AWS service page, or go directly to the AWS Management Console. For full documentation, see the Claude Platform on AWS User Guide and the Anthropic documentation.


About the authors

Andrea Gallo

Andrea Gallo

Andrea is a Solutions Architect at AWS. He holds a bachelor’s and master’s degree in computer engineering from the Polytechnic of Milan and brings 15 years of experience leading an IT Performance and Optimization tech services startup. He is dedicated to helping startups architect high-performance, scalable AI systems.

Ayan Ray

Ayan Ray

Ayan is a Principal Partner Solutions Architect and AI Tech Lead at AWS, serving as the Worldwide Tech Lead for Anthropic at AWS. He works at the intersection of cloud architecture and Artificial Intelligence, helping organizations adopt and scale Anthropic’s technologies on AWS.

Jat AI Stay informed with the latest in artificial intelligence. Jat AI News Portal is your go-to source for AI trends, breakthroughs, and industry analysis. Connect with the community of technologists and business professionals shaping the future.