Learning center

Find why an AWS CLI command uses the wrong caller

Check the CLI's resolved identity before changing a policy. A profile name is a configuration selector. The account and ARN from STS tell you who signed the check.

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.

Trace another denied request.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading