Skip to main content
AWS AssumeRole lets Baseten pull private base images from Amazon ECR and download model weights from Amazon S3 by assuming an IAM role in your AWS account. You add a trust policy to an IAM role, and Baseten calls sts:AssumeRole directly.
Baseten enables AWS AssumeRole by default for Enterprise organizations. On other plans, contact Baseten support or your Baseten representative to enable it.

How it works

  1. Baseten uses a dedicated IAM role only to access customer AWS resources.
  2. Baseten assigns your organization a unique, randomly generated external ID. After Baseten enables AWS AssumeRole for your organization, use truss whoami --show-aws-assume-role. The command returns the external ID and the Baseten role ARN.
  3. You create an IAM role in your AWS account with read access to your ECR repositories or S3 buckets, and a trust policy that allows Baseten’s role to assume it and requires your external ID.
  4. At build time, Baseten assumes your role with short-lived AWS Security Token Service (STS) credentials, presenting your organization’s external ID, and pulls the image or mirrors the weights.

Set up AWS AssumeRole

1

Get the Baseten role ARN and your external ID

Run truss whoami --show-aws-assume-role and copy both values:
AWS AssumeRole output
2

Create an IAM role with a trust policy

Create an IAM role in your AWS account with this trust policy. Replace the placeholders with the Baseten role ARN and your external ID:
IAM trust policy
3

Attach permissions policies

Attach read-only policies for the resources your models need: ECR pull access for private base images or S3 read access for the buckets holding your model weights. For example:
ECR access (for base images)
Scope the pull actions to your repository. The ecr:GetAuthorizationToken action does not support resource-level permissions, so it keeps "Resource": "*".
S3 access (for model weights)
4

Reference the role in your Truss configuration

Configure auth_method: AWS_ASSUME_ROLE with your role’s ARN and its region in config.yaml. See Private registries (ECR) for base images and AWS S3 weights authentication for model weights.

Limitations

  • AWS to AWS only. Use AssumeRole only for AWS resources. For Google Cloud resources, use GCP OIDC.
  • Build-time access only. AWS AssumeRole covers pulling base images from ECR and mirroring model weights from S3. For your model code calling AWS services at inference time, use OIDC at request time.
  • Organization-wide scoping. The trust policy grants access for your whole Baseten organization. Baseten presents the same external ID for every model in it.

Troubleshooting

Audit role assumptions in CloudTrail

CloudTrail records role assumptions as AssumeRole events from the Baseten role. Baseten prefixes session names with baseten-model-build-. Use these events to verify when and how often Baseten accesses your resources.

Common errors