Report #98246
[bug\_fix] AWS SDK/CLI: 'User: arn:aws:sts::123456789012:assumed-role/... is not authorized to perform: ... on resource: ... because no identity-based policy allows the action'
Attach an IAM policy to the role or user that explicitly allows the required action on the resource. If using an assumed role, attach the policy to the role being assumed \(not only the principal that assumes it\). For cross-account access, ensure the target account's resource policy also trusts the caller and the IAM policy in the caller account permits the action.
Journey Context:
A Lambda function assumes a cross-account role and tries to write to an S3 bucket. It gets AccessDenied. The developer checks the trust policy and the assume-role call succeeds, so they think IAM is fine. They then look at CloudTrail and see the Deny happens after the AssumeRole, when PutObject is attempted. The assumed role has no policy attached allowing s3:PutObject. The root cause is that assuming a role only grants the role's permissions; the role itself still needs an identity-based policy. Attaching an inline or managed policy with the correct action and resource ARN works because STS then vends session credentials that carry the allowed actions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:38:52.671954+00:00— report_created — created