Skip to content

Instantly share code, notes, and snippets.

@JohnPreston
Created May 26, 2016 17:02
Show Gist options
  • Save JohnPreston/e5c6572992e68ee808cc0d2974aa1e43 to your computer and use it in GitHub Desktop.
Save JohnPreston/e5c6572992e68ee808cc0d2974aa1e43 to your computer and use it in GitHub Desktop.
Get all the policies of a group
#!/usr/bin/env bash
for policy in `aws iam list-group-policies --group-name $GROUP_NAME --endpoint-url=$IAM_URL --region euca --output=text | awk '{print $2}'` ; do
aws iam get-group-policy --policy-name "$policy" --group-name $GROUP_NAME --endpoint-url=$IAM_URL --region euca > "$policy".json
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment