Skip to content

Instantly share code, notes, and snippets.

@anairinac
Created November 7, 2022 22:07
Show Gist options
  • Save anairinac/4047c3677d321360acc7190a25bb91e8 to your computer and use it in GitHub Desktop.
Save anairinac/4047c3677d321360acc7190a25bb91e8 to your computer and use it in GitHub Desktop.
Get a list of AWS IAM Policies that have Glue permissions for all roles in account
roles=$(aws iam list-roles --query 'Roles[*].Arn' --output text)
for arn in $roles; do
echo filtering glue policies for arn $arn
policies=$(aws iam list-policies-granting-service-access --service-namespaces glue --arn=$arn --output text)
for policy in $policies; do
echo $policy
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment