Skip to content

Instantly share code, notes, and snippets.

@coldclimate
Created March 24, 2016 08:51
Show Gist options
  • Save coldclimate/464e6e5174d9a5ffcc6a to your computer and use it in GitHub Desktop.
Save coldclimate/464e6e5174d9a5ffcc6a to your computer and use it in GitHub Desktop.
Get a list of all access keys on an AWS account
for USERNAME in `aws iam list-users | jq -r '.Users[].UserName'`
do
KEYS=$(aws iam list-access-keys --user-name $USERNAME | jq '.AccessKeyMetadata[].AccessKeyId')
echo $USERNAME, $KEYS
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment