Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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"
for U in $(aws iam list-users --query 'Users[].UserName[]' --output text); do
echo "$U"
aws iam list-attached-user-policies --user-name "$U"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment