A deploy workflow that worked yesterday fails at `aws-actions/configure-aws-credentials` with "Not authorized to perform sts:AssumeRoleWithWebIdentity".
Likely causes → The OIDC token's claims no longer match the IAM role's trust policy. Common triggers: the job now uses a GitHub environment (so sub becomes repo:org/app:environment:prod instead of ref:refs/heads/main), the repo was renamed or transferred, the workflow runs from a tag or PR, or permissions: id-token: write was removed.
Diagnose →
aws iam get-role --role-name gha-deploy --query 'Role.AssumeRolePolicyDocument.Statement[].Condition'
In the workflow, print the claims safely (the token is short-lived but still don't log it in full; decode only sub, aud, ref). CloudTrail logs the failed AssumeRoleWithWebIdentity with the exact subject.
Fix → Update the trust condition to the subject the job actually sends:
"StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" },
"StringLike": { "token.actions.githubusercontent.com:sub": "repo:acme/app:environment:prod" }
and make sure the job has permissions: { id-token: write, contents: read }.
Prevent → Manage trust policies in Terraform next to the workflow conventions, and keep the condition specific (repo plus environment or branch), never repo:acme/*.