Skip to content

Instantly share code, notes, and snippets.

@matschaffer
Created March 19, 2021 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matschaffer/8965e392791cf02498acce0e8d5c28c6 to your computer and use it in GitHub Desktop.
Save matschaffer/8965e392791cf02498acce0e8d5c28c6 to your computer and use it in GitHub Desktop.
Shows all role and user policies - Helpful for deprecation of AWSElasticBeanstalkService
for R in $(aws iam list-roles --query 'Roles[].RoleName[]' --output text); do
echo "$R"
aws iam list-attached-role-policies --role-name "$R"
done
for U in $(aws iam list-users --query 'Users[].UserName[]' --output text); do
echo "$U"
aws iam list-attached-user-policies --user-name "$U"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment