In an illustrative reconciliation job, the shell sets AWS_PROFILE=reports, but the weekly job reports account 444455556666. The approved reports role is in 111122223333. Use the CLI configuration summary to see which credential source produced the STS caller.
aws configure list
aws sts get-caller-identity --query '[Account,Arn]' --output text
Read the Type and Location columns of the first command locally. For example, existing environment credentials can take precedence over credentials in a named profile selected by AWS_PROFILE. Inspect the job's launch configuration for the source AWS actually used. Keep credential values out of the incident ticket. Recheck the caller from the corrected job context before requesting an IAM change. AWS CLI precedence · CLI configure list · STS GetCallerIdentity
A CLI command inside the job establishes the CLI caller at that time. If the application uses its own SDK credential configuration, use the failed request's audit record to identify the application caller.