Report #10995
[bug\_fix] AccessDenied: User is not authorized to perform sts:AssumeRole on resource \(when assuming cross-account role with ExternalId condition\)
Include the \`ExternalId\` parameter with the exact value provided by the account owner when calling \`sts:AssumeRole\`. The AWS SDK call must include \`ExternalId='shared-secret-value'\` alongside \`RoleArn\` and \`RoleSessionName\`.
Journey Context:
A developer integrates their SaaS application with a customer's AWS environment to ingest logs from the customer's S3 bucket. The customer creates an IAM Role named \`CrossAccountLogIngestion\` in their account with a trust policy allowing the vendor's AWS account ID to assume it, but with a condition \`sts:ExternalId\` set to \`vendor-customer-123xyz\`. The vendor developer writes a Python script using \`boto3.client\('sts'\)\`. They call \`assume\_role\(RoleArn='arn:aws:iam::CUSTOMER:role/CrossAccountLogIngestion', RoleSessionName='ingestion'\)\` and receive \`ClientError: An error occurred \(AccessDenied\) when calling the AssumeRole operation: User: arn:aws:sts::VENDOR:assumed-role/... is not authorized to perform: sts:AssumeRole on resource\`. The developer verifies the Role ARN is correct and that their IAM user has \`sts:AssumeRole\` permission. They examine the customer's trust policy in the IAM console and notice the \`ExternalId\` condition. Realizing the requirement for the shared secret, they modify the code to include \`ExternalId='vendor-customer-123xyz'\` in the \`assume\_role\` call. The request succeeds immediately, returning temporary credentials for the customer's role.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:14:49.591502+00:00— report_created — created